Skip to content

Instantly share code, notes, and snippets.

View oaleynik's full-sized avatar

Oleh Aleinyk oaleynik

  • CloudSpot
View GitHub Profile
@oaleynik
oaleynik / 0_reuse_code.js
Created July 4, 2014 11:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@oaleynik
oaleynik / Makefile
Created December 17, 2014 17:09 — forked from andreypopp/gist:5588256
Sample Makefile
BIN = ./node_modules/.bin
SRC = $(wildcard src/*.coffee)
LIB = $(SRC:src/%.coffee=lib/%.js)
build: $(LIB)
lib/%.js: src/%.coffee
@mkdir -p $(@D)
@$(BIN)/coffee -bcp $< > $@

To Update to 1.0.1l (This is the most 'up to date' OpenSSL, but is a major revision to the system OpenSSL and consequently carries more risk than the minor revision above.).

Open up ‘Terminal’ under /Applications/Utilities and execute:

@oaleynik
oaleynik / objectToQueryString.js
Last active August 29, 2015 14:27 — forked from dgs700/objectToQueryString.js
Javascript object to URL encoded query string converter. Code extracted from jQuery.param() and boiled down to bare metal js. Should handle deep/nested objects and arrays in the same manner as jQuery's ajax functionality.
var objectToQueryString = function (a) {
var prefix, s, add, name, r20, output;
s = [];
r20 = /%20/g;
add = function (key, value) {
// If value is a function, invoke it and return its value
value = ( typeof value == 'function' ) ? value() : ( value == null ? "" : value );
s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
};
if (a instanceof Array) {
@oaleynik
oaleynik / gist:dd481c95c68ed04eaff0
Created November 9, 2015 18:29 — forked from mikhailov/gist:9639593
Nginx S3/Unicorn Proxy with backend keep alive
# The Nginx configuration based on https://coderwall.com/p/rlguog
http {
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 15m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
@oaleynik
oaleynik / fastly.vcl
Created November 10, 2015 09:37 — forked from mdemare/fastly.vcl
C!
# Backends
backend F_addr_api_example_com {
.connect_timeout = 1s;
.dynamic = true;
.port = "443";
.host = "api.example.com";
.first_byte_timeout = 15s;
.max_connections = 200;
@oaleynik
oaleynik / .eslintrc
Created November 30, 2015 00:47 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@oaleynik
oaleynik / build_nginx.sh
Last active December 13, 2015 20:07 — forked from MattWilcox/build_nginx.sh
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2e
export VERSION_NGINX=nginx-1.9.7
# URLs to the source directories
export SOURCE_OPENSSL=https://www.openssl.org/source/
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/