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
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() +'.' +
randomByte();
if (isPrivate(ip)) return randomIp();
@murtaugh
murtaugh / cursor-reset.css
Last active Apr 17, 2019
CSS Cursor Reset
View cursor-reset.css
html,
body {
cursor: default;
}
code {
cursor: text;
}
/*
@weotch
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
require.config({
// Base path used to load scripts
baseUrl: 'js/',
// Prevent caching during dev
urlArgs: "bust=" + (new Date()).getTime(),
@plentz
plentz / nginx.conf
Last active Jul 21, 2019
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@pgilad
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 = 'https://ssl.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
@nisaacson
nisaacson / README.md
Last active Mar 24, 2016
Vim Javascript indentation via esformatter. Idea insired by http://yieldthedog.github.io/blog/2013/03/01/invoke-js-beautify-in-vim/
View README.md
@kjantzer
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 http://stackoverflow.com/a/14966131/484780
TODO
- needs improved (objects as values)
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active Jul 21, 2019
how to delete a git tag locally and remote
View git-tag-delete-local-and-remote.sh
# 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
branneman / better-nodejs-require-paths.md
Last active Jul 20, 2019
Better local require() paths for Node.js
View better-nodejs-require-paths.md

Better local require() paths for Node.js

Problem

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
joelhooks / gear.md
Last active May 19, 2019
Podcasting Gear List
View gear.md
You can’t perform that action at this time.