Skip to content

Instantly share code, notes, and snippets.

@ThomasBurleson
ThomasBurleson / gist:1910025
Created February 25, 2012 18:45
Using $.post() with Promises
// an IIFE that illustrates different implementations
// of $.post() with Promises
//
// Check out jsFiddle `jQuery and Promises with UI animation`
// - demonstrates $.Deferrred() and custom $.when()
// - @ http://jsfiddle.net/ThomasBurleson/RTLr6/179/
//
var onSubmitFeedback = (function () {
var target = $("#container").append("<div class='spinner'>");
@kyleferguson
kyleferguson / .vimrc
Created February 10, 2016 22:14
Show vim highlighting groups for work under cursor (ctrl-g)
" Show highlighting groups for current word
nmap <c-g> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
@tml
tml / mud-story.txt
Created October 11, 2012 16:50 — forked from anonymous/gist:3158796
Because you shouldn't have to put up with profanity...
to get a list of free programming books, here's the list from a Zed Shaw & Co. programming-related, profanity-filled website.
<div style="text-align: left">
<table>
<tbody><tr><th colspan="3">Programming Languages</th>
</tr><tr>
<td><a href="#Assembly Language">Assembly Language</a></td>
<td><a href="#Bash">Bash</a></td>
<td><a href="#C / C++">C / C++</a></td>
</tr>
@laracasts
laracasts / test.php
Last active July 10, 2018 16:33
Transactions for functional/integration tests.
<?php
class ExampleTest extends TestCase {
public function setUp()
{
parent::setUp();
DB::beginTransaction();
}
@davestern
davestern / hosts
Last active October 30, 2018 08:04
Ansible: how to set hostname before DNS assigned
ec2-1-2-3-4.compute-1.amazonaws.com new_hostname=new-hostname.example.com
ec2-5-6-7-8.compute-1.amazonaws.com
@exodus4d
exodus4d / nginx.conf
Last active January 2, 2020 04:28
nginx.conf for Pathfinder (Nginx v1.11.8)
# nginx Configuration File
# http://wiki.nginx.org/Configuration
# Run as a less privileged user for security reasons.
user nginx nginx;
# How many worker threads to run;
# "auto" sets it to the number of CPU cores available in the system, and
# offers the best performance. Don't set it higher than the number of CPU
# cores if changing this parameter.
@zaherg
zaherg / install.md
Last active October 18, 2020 17:45
a small tips to install latest nginx , php 5.5 & laravel 4.1 since that Laravel 4.1 has been released, i have removed the line which explain how to install laravel from dev branch using composer.

Creating Your Laravel & nginx Server

We will install Larave 4.1 with PHP5.5 & Latest nginx on Ubuntu 12.04.3 x64.

updating your system

apt-get update && apt-get upgrade
adduser [username]
usermod -aG sudo [username]
apt-get -y install git
@nakedible-p
nakedible-p / proxy.js
Created October 19, 2015 19:55
AWS ES proxy
var AWS = require('aws-sdk');
var http = require('http');
var httpProxy = require('http-proxy');
var express = require('express');
var bodyParser = require('body-parser');
var stream = require('stream');
if (process.argv.length != 3) {
console.error('usage: aws-es-proxy <my-cluster-endpoint>');
process.exit(1);
@mmalecki
mmalecki / nextTick.js
Created October 2, 2011 12:13
process.nextTick vs setTimeout(fn, 0)
for (var i = 0; i < 1024 * 1024; i++) {
process.nextTick(function () { Math.sqrt(i) } )
}
@magnetikonline
magnetikonline / README.md
Last active November 27, 2023 21:12
Setting Nginx FastCGI response buffer sizes.