Skip to content

Instantly share code, notes, and snippets.

View ismnoiet's full-sized avatar

ismnoiet

  • Planet Earth
View GitHub Profile
function Emitter(){
this.events = {};
}
Emitter.prototype.emit = function(eventType,data){
this.events[eventType].map(function(callback){
callback.call(null,data);
});
}
@ismnoiet
ismnoiet / 00.howto_install_phantomjs.md
Created August 11, 2016 22:50 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@ismnoiet
ismnoiet / refresh-spotlight-index.sh
Last active July 26, 2017 20:02
Refresh spotlight index to list the newly installed applications
# pboblem : some applications can't be found using spotlight search box.
# solution : reload the metadata plist
# source : http://apple.stackexchange.com/questions/62715/applications-dont-show-up-in-spotlight
# Turn off spotlight
sudo mdutil -a -i off
# Unload it :
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
@ismnoiet
ismnoiet / backbone-sync-override.js
Created February 12, 2017 13:17 — forked from elijahmanor/backbone-sync-override.js
Overriding Backbone.sync to POST instead of PUT/DELETE/PATCH
// The following could have been replaced by setting `Backbone.emulateHTTP = true;`
Backbone._sync = Backbone.sync;
Backbone.sync = function( method, model, options ) {
var beforeSend = options.beforeSend;
options = options || {};
if ( method === "update" || method === "delete" || method === "patch" ) {
options.beforeSend = function( xhr ) {
@ismnoiet
ismnoiet / generate-gpx.js
Created July 1, 2017 02:38
genereate gpx file to simulate location one iPhone device using xcode
// 1. find location latitude & longitude of desired location and name of location
// 2. call generate_gpx using previous data
// alternative, you can use http://gpx-poi.com to generate .gpx file
function generate_gpx(lat,lon,name,time='2017-07-01T02:24:02Z'){
return `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"