Skip to content

Instantly share code, notes, and snippets.

@subfuzion
subfuzion / curl.md
Last active July 25, 2024 08:53
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@paulirish
paulirish / bling.js
Last active July 23, 2024 14:51
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@smirn0v
smirn0v / gist:b8e6c4bedebed23a0328
Last active February 24, 2023 09:44
Edit gerrit project config
# checkout
git fetch origin refs/meta/config:refs/remotes/origin/meta/config
git checkout meta/config
#directly:
git push origin meta/config:meta/config
#via review:
git push origin meta/config:refs/for/refs/meta/config
@guilleiguaran
guilleiguaran / application-9f8b759dfbefae75069a6cefd9d13932.css
Created January 22, 2014 16:55
Sprockets preprocessor for asset paths
body{background-image:url("/assets/background-0539f790ccc171714d5ad38f5524423e.jpg")}
@mpeteuil
mpeteuil / rubocop_pre_commit_hook
Created August 3, 2013 17:44
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/usr/bin/env ruby
require 'english'
require 'rubocop'
ADDED_OR_MODIFIED = /A|AM|^M/.freeze
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
@benschwarz
benschwarz / .bowerrc
Last active April 3, 2019 07:55
Bower + Rails asset pipeline
{
"directory": "vendor/assets/components"
}
@elentok
elentok / nginx.conf
Created June 24, 2013 11:07
Redirect favicon.ico, robots.txt, 500/404/422.html to public
server {
listen 80;
server_name subdomain.domain.com;
location ~* ^/(favicon.ico|robots.txt|500.html|404.html|422.html)$ {
root /home/rails/website/current/public;
try_files $uri =404;
}
}
@MrSwitch
MrSwitch / saveAs.js
Created August 31, 2012 13:55
FileSaver window.saveAs shim
// window.saveAs
// Shims the saveAs method, using saveBlob in IE10.
// And for when Chrome and FireFox get round to implementing saveAs we have their vendor prefixes ready.
// But otherwise this creates a object URL resource and opens it on an anchor tag which contains the "download" attribute (Chrome)
// ... or opens it in a new tab (FireFox)
// @author Andrew Dodson
// @copyright MIT, BSD. Free to clone, modify and distribute for commercial and personal use.
window.saveAs || ( window.saveAs = (window.navigator.msSaveBlob ? function(b,n){ return window.navigator.msSaveBlob(b,n); } : false) || window.webkitSaveAs || window.mozSaveAs || window.msSaveAs || (function(){
@danparsons
danparsons / gist:3195652
Created July 29, 2012 01:46
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

@rdeaton
rdeaton / gist:2838397
Created May 30, 2012 19:20
Sprite Ideas
Alternative forms of collision detection
- Possible use of algorithms like quadtrees and spatial hashing
Positioning based on tuples/numpy arrays vs Rects
Anchor points
Improved layering system
"Automated" dirty rendering
A Group which implements the Sprite protocol (aggregate sprites)
Properties which change sprites in various ways:
- angle of rotation
- scale (zoom in or out)