Skip to content

Instantly share code, notes, and snippets.

// Core assets
let coreAssets = [];
// On install, cache core assets
self.addEventListener('install', function (event) {
// Cache core assets
event.waitUntil(caches.open(coreID).then(function (cache) {
for (let asset of coreAssets) {
cache.add(new Request(asset));
@quelicm
quelicm / Remove all git tags
Last active June 19, 2019 13:17 — forked from okunishinishi/Remove all git tags
Delete all git remote tags #git #tags
# Based on: https://gist.github.com/mobilemind/7883996
# List all tags
git tag
# Search tags
git tag -l tag-pattern-to-search
# delete local tag '12345'
git tag -d 12345
@quelicm
quelicm / native-promise-deferred.js
Created October 15, 2017 17:28 — forked from flaki/native-promise-deferred.js
Deferred objects tooling based on the native ES6 Promise implementation
/*
* Extends native promises with deferred objects.
* Deferreds return an object that has a <promise>, which could be resolved via
* the included <resolve> and <reject> calls.
*/
if (Promise && !("deferred" in Promise)) Promise.deferred = function() {
var fResolve,
fReject,
P = new Promise(function(resolve, reject) {
fResolve = resolve;
@quelicm
quelicm / multiple_ssh_setting.md
Last active June 16, 2019 08:18 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github #git

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@quelicm
quelicm / rem-calibrate.css
Last active June 16, 2019 08:19 — forked from brianblakely/rem-calibrate.css
Allow to android config font-size inferior 8px #css
/* Android stock browser won't let you set font-size smaller than 8px unless you apply this. */
:root {
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
-ms-text-size-adjust: none;
-o-text-size-adjust: none;
text-size-adjust: none;
}
@quelicm
quelicm / dabblet.css
Last active June 16, 2019 08:22 — forked from LeaVerou/dabblet.css
Image interpolation demo #css
/* Image interpolation demo
WebKit-only at the time (April 2012)
*/
@keyframes browsers {
20% { background-image: url('http://lea.verou.me/css-4d/img/chrome-logo.png'); }
40% { background-image: url('http://lea.verou.me/css-4d/img/safari-logo.png'); }
60% { background-image: url('http://lea.verou.me/css-4d/img/opera-logo.png'); }
80% { background-image: url('http://lea.verou.me/css-4d/img/ie-logo.png'); }
}
@quelicm
quelicm / phonegap-photofetcher.js
Created April 19, 2012 05:57 — forked from pamelafox/phonegap-photofetcher.js
PhoneGap Convert Photo File URI to Data URI
function getPhoto() {
navigator.camera.getPicture(onPhotoSuccess, onPhotoFail,
{quality: 70, targetWidth: 500, targetHeight: 500,
sourceType: navigator.camera.SourceType.PHOTOLIBRARY,
destinationType: navigator.camera.DestinationType.FILE_URI,
});
}
function onPhotoSuccess(imageUri) {
var $img = $('<img/>');
@quelicm
quelicm / Base64Image.php
Created April 14, 2012 07:33 — forked from simme/Base64Image.php
Returns the Base64 encoded version of an image. Has basic support for Drupal module ImageCache. Does not depend on Drupal.
<?php
/**
* @file
* Helper class for encoding images as Base64.
* Has support for the Drupal module ImageCache, just provide it with your
* preset name if you'd like the class to use that version of an image instead.
* Is by no means dependent on Drupal though. Just a nice feature.
* Feel free to use it as you like.
*
* @author Simon Ljungberg <[email protected]>
// Simple debug output helper
function debug(message) {
Ti.API.info(message);
}
/**
*
* @param thisControl The control you wish to dump
* @param goDeep boolean Do you want deep introspection
* @param incFuncs boolean Do you want to include functions in the output when going deep
@quelicm
quelicm / gist:1743796
Created February 5, 2012 07:25 — forked from vivirenremoto/gist:1730750
cron bufferapp rss updates
<?php
// CONFIG
$access_token = '';
$profile_ids = '';
$limit = 1;
$urls = array(
'http://feeds.feedburner.com/betabeersjobs',