Skip to content

Instantly share code, notes, and snippets.

View abrudtkuhl's full-sized avatar
🥓

Andy Brudtkuhl abrudtkuhl

🥓
View GitHub Profile
@karmi
karmi / nginx-elasticsearch-proxy.conf
Created May 23, 2011 08:16
Route requests to ElasticSearch to authenticated user's own index with an Nginx reverse-proxy
# Run me with:
#
# $ nginx -p /path/to/this/file/ -c nginx.conf
#
# All requests are then routed to authenticated user's index, so
#
# GET http://user:password@localhost:8080/_search?q=*
#
# is rewritten to:
#
@artero
artero / launch_sublime_from_terminal.markdown
Last active January 25, 2024 16:57 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@vongillern
vongillern / gist:5dddaa6a636ceeb177e8
Created January 8, 2015 14:44
Javascript convert UTC date to a different timezone using moment.timezone.js and d3.js
var dateFormat = d3.time.format("%m/%d/%Y %H:%M:%S");
function dateConversion(utcTimestamp) {
//it took me nearly an entire day to write this one stupid line of code because js dates => teh suck
//the date from the file comes in as UTC (below)
//UTC: 1/7/2015 10:49:07 PM
//these are the equivilient
//America/Chicago: 1/7/2015 4:49:07 PM
@rayrutjes
rayrutjes / ais-wp.css
Created July 7, 2016 12:48
Some boilerplate to create an instantsearch.js search experience in your WordPress theme. This works in combination with the Algolia Search plugin for WordPress.
#ais-wrapper {
display: flex;
}
#ais-main {
padding: 1rem;
width: 100%;
}
@BenSampo
BenSampo / deploy.sh
Last active March 23, 2024 05:30
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH