Skip to content

Instantly share code, notes, and snippets.

View zorbash's full-sized avatar
👨‍💻
'); DROP TABLE recruiters;

Dimitris Zorbas zorbash

👨‍💻
'); DROP TABLE recruiters;
View GitHub Profile
@zorbash
zorbash / map_caps_to_esc.sh
Last active December 23, 2015 00:09
Map your caps key to esc
xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' # map caps to escape
setxkbmap -option ctrl:nocaps #disable caps default functionality
setxkbmap -option grp:alt_shift_toggle us,gr # map alt shift to layout toggle
@benschwarz
benschwarz / .bowerrc
Last active April 3, 2019 07:55
Bower + Rails asset pipeline
{
"directory": "vendor/assets/components"
}
@willurd
willurd / web-servers.md
Last active May 23, 2024 20:20
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
@justinbmeyer
justinbmeyer / jsmem.md
Last active August 19, 2022 04:50
JS Memory

JavaScript Code

var str = "hi";

Memory allocation:

Address Value Description
...... ...
@zorbash
zorbash / nginx.conf
Created December 18, 2012 01:57 — forked from mimosz/nginx.conf
# sudo ln -s ~/nginx.conf unicorn.conf
upstream app_server {
server unix:/tmp/unicorn_padrino.sock fail_timeout=0;
}
server {
listen 80;
charset utf-8;
server_name db.innshine.com;
@nhoizey
nhoizey / screenshots.js
Created November 12, 2012 17:07
Take screenshots at different viewport sizes using CasperJS
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();
@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@guerrerocarlos
guerrerocarlos / main.js
Created September 6, 2012 05:07
loading socket.io using require.js
// Require.js allows us to configure shortcut alias
require.config({
// The shim config allows us to configure dependencies for
// scripts that do not call define() to register a module
shim: {
'socketio': {
exports: 'io'
},
'underscore': {
exports: '_'
@karmi
karmi / .gitignore
Created August 16, 2012 12:00
Ember.js application with elasticsearch persistence and Goliath based proxy [http://www.elasticsearch.org/tutorials/2012/08/22/javascript-web-applications-and-elasticsearch.html]
.DS_Store
tmp/