Skip to content

Instantly share code, notes, and snippets.

I'm hiring!

Ahmed Nuaman ahmednuaman

I'm hiring!
View GitHub Profile
kyledrake / ferengi-plan.txt
Last active Jul 12, 2021
How to throttle the FCC to dial up modem speeds on your website using Nginx
View ferengi-plan.txt
# The blog post that started it all:
# Current known FCC address ranges:
# Confirm/locate FCC IP ranges with this:
# In your nginx.conf:
location / {
evandhoffman / fail1.conf
Last active Oct 8, 2015
Nginx add_header
View fail1.conf
# Nginx will fail to start and will throw an error like this:
# Reloading nginx configuration: nginx: [emerg] "add_header" directive is not allowed here in /etc/nginx/sites-enabled/fail1.conf:39
server {
listen 8080 default;
server_name _;
root /var/www/html ;
View Recruiter Domains
This has moved to...
dergachev /
Last active Dec 1, 2021
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF


To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

Mithrandir0x / gist:3639232
Created Sep 5, 2012
Difference between Service, Factory and Provider in AngularJS
View gist:3639232
// Source:!topic/angular/hVrkvaHGOfc
// jsFiddle:
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
jlong / uri.js
Created Apr 20, 2012
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "";
parser.protocol; // => "http:"
parser.hostname; // => ""
parser.port; // => "3000"
parser.pathname; // => "/pathname/"; // => "?search=test"
parser.hash; // => "#hash"; // => ""
jpoehls / main.js
Created Feb 17, 2012
Benchmark.js deferred
View main.js
var Benchmark = require('benchmark');
var request = require('request');
var suite = new Benchmark.Suite;
// add tests
suite.add('Calling cow api', {
defer: true,
fn: function(deferred) {
yellowled / ffmpeg-html5
Created Dec 6, 2011
Convert videos to proper formats for HTML5 video on Linux shell using ffmpeg. Will probably convert this to a bash script later, but for the time being, here's some examples. Not sure there have actually sensible dimensions and bitrates for web video.
View ffmpeg-html5
# webm
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm
# mp4
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4
# ogg (if you want to support older Firefox)
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend
View orientation-tests.txt
innerWidth / innerHeight tests @
Tested (14 devices, 28 browsers):
Droid 2 Global Android 2.2
iPhone 4 iOS5 (Safari, Opera Mini)
Motorola Atrix Android 2.3.4 (Stock browser, Dolphin, Skyfire, Opera Mini, Firefox)
Samsung Galaxy S9000 Android 2.3 (Webkit, Opera Mobile)
Samsung Galaxy Y Android 2.3.5
redoPop / .gitignore
Created Jun 18, 2010
Template .gitignore file for WordPress projects
View .gitignore
# This is a template .gitignore file for git-managed WordPress projects.
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
# See the comments below for more info on how to add exceptions for your