Skip to content

Instantly share code, notes, and snippets.


Gilad Peleg pgilad

Block or report user

Report or block pgilad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
TheBigSadowski / anon.js
Last active Jun 25, 2019
Random IP address generator for anonymizing data.
View anon.js
randomByte = function() {
return Math.round(Math.random()*256);
randomIp = function() {
var ip = randomByte() +'.' +
randomByte() +'.' +
randomByte() +'.' +
if (isPrivate(ip)) return randomIp();
murtaugh / cursor-reset.css
Last active Sep 13, 2019
CSS Cursor Reset
View cursor-reset.css
body {
cursor: default;
code {
cursor: text;
weotch / main.js
Last active Mar 13, 2016
Backbone routing example using require.js
View main.js
// This our standard require js bootstrap file. It assumes you are using the
// require-jquery.js file that require.js provides
// Set the require.js configuration for the application
// Base path used to load scripts
baseUrl: 'js/',
// Prevent caching during dev
urlArgs: "bust=" + (new Date()).getTime(),
plentz / nginx.conf
Last active Nov 12, 2019
Best nginx configuration for improved security(and performance). Complete blog post here
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
pgilad / gaInit.js
Last active Jun 22, 2016
Google Analytics ga.js for chrome extensions - snippit that doesn't report on development enviornment
View gaInit.js
//replace UA-XXXXXXXX-X *ONLY* with your real UA Account ID.
//DO not replace the UA-99999999-X with anything, as that is the point of this.
var _gaq = _gaq || [];
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = '';
var s = document.getElementsByTagName('script')[0];
nisaacson /
Last active Mar 24, 2016
Vim Javascript indentation via esformatter. Idea insired by
kjantzer / backbone.collection.saveToCSV.js
Last active May 14, 2017
Backbone.Collection.saveToCSV() — adds ability to save all of the collections models as a CSV file. NOTE: only tested on Chrome; may not work on all browsers, but would work well for packaged Chrome apps.
View backbone.collection.saveToCSV.js
Save To CSV 0.0.2
@author Kevin Jantzer, Blackstone Audio
@since 2015-01-16
intial code from
- needs improved (objects as values)
mobilemind /
Last active Nov 10, 2019
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
branneman /
Last active Nov 12, 2019
Better local require() paths for Node.js

Better local require() paths for Node.js


When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

joelhooks /
Last active Nov 11, 2019
Podcasting Gear List
You can’t perform that action at this time.