Skip to content

Instantly share code, notes, and snippets.

@yblee85
yblee85 / distance.js
Created Jan 30, 2020 — forked from mattpowell/distance.js
Get the distance between two (world) coordinates - a nodejs module
View distance.js
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* */
/* Simple node js module to get distance between two coordinates. */
/* */
/* Code transformed from Chris Veness example code - please refer to his website for licensing */
/* questions. */
/* */
/* */
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2011 */
/* - www.movable-type.co.uk/scripts/latlong.html */
@yblee85
yblee85 / temporary-email-address-domains
Created Sep 26, 2017 — forked from adamloving/temporary-email-address-domains
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
View temporary-email-address-domains
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@yblee85
yblee85 / redis_delete_keys_pattern.sh
Created Jun 7, 2017 — forked from JeromeParadis/redis_delete_keys_pattern.sh
Redis: How delete keys matching a pattern?
View redis_delete_keys_pattern.sh
redis-cli KEYS "prefix:*" | xargs redis-cli DEL
View gist:a8c8bfafe8853515b32972160e5a00d9
NOTE : First commit your current changes, or you will lose them.
Then run the following commands from the top folder of your git repo:
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
source : http://stackoverflow.com/questions/11451535/gitignore-is-not-working
@yblee85
yblee85 / git_replace_master_with_a_branch.txt
Created Apr 27, 2016
Git (replace master with a branch)
View git_replace_master_with_a_branch.txt
// sometimes accidently you switched to a branch and working on it
// and forgot to merge with master for a long long time
// now it would be really difficult to merge with master
// this will basically replace master with a branch
// say, you have a master and a branch named "branch1"
git checkout branch1
git merge -s ours master
git checkout master
git merge branch1
@yblee85
yblee85 / readme.txt
Created Oct 22, 2015
Create Bootable USB from directory in Windows
View readme.txt
//command line
diskpart
//diskpart command line
list disk
//it will show disk
// disk0, 1, 2
select disk 2
clean
@yblee85
yblee85 / updateFavicon.js
Created Sep 23, 2015
update favicon dynamically
View updateFavicon.js
function updateFavicon(faviconURL) {
var src = faviconURL;
var head_node = document.head || document.getElementsByTagName('head')[0];
var link = document.createElement('link'),
oldLink = document.getElementById('favicon');
link.id = 'favicon';
link.rel = 'shortcut icon';
link.href = src;
if (oldLink) {
head_node.removeChild(oldLink);
@yblee85
yblee85 / includeCSS.js
Created Sep 23, 2015
include CSS file / add new CSS
View includeCSS.js
function includeCSSfile(href) {
var head_node = document.head || document.getElementsByTagName('head')[0];
var link_tag = document.createElement('link');
link_tag.setAttribute('rel', 'stylesheet');
link_tag.setAttribute('type', 'text/css');
link_tag.setAttribute('href', href);
head_node.appendChild(link_tag);
}
@yblee85
yblee85 / gist:50da5b708b7c7470762c
Created Sep 17, 2015
Bootable USB from directory in Windows
View gist:50da5b708b7c7470762c
//command line
diskpart
//diskpart command line
list disk
//it will show disk
// disk0, 1, 2
select disk 2
clean
@yblee85
yblee85 / increase_number_of_max_open_files
Created May 27, 2015
Ubuntu, Increase number of max open files
View increase_number_of_max_open_files
edit /etc/security/limits.conf
# non-root users
* soft nofile 40000
* hard nofile 40000
# root users
root soft nofile 40000
root hard nofile 40000
You can’t perform that action at this time.