Skip to content

Instantly share code, notes, and snippets.

View olegakbarov's full-sized avatar
🐢
Slow but inevitable

Oleg Akbarov olegakbarov

🐢
Slow but inevitable
View GitHub Profile
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@olegakbarov
olegakbarov / INSTALLATION.md
Last active July 10, 2020 18:27 — forked from DenisIzmaylov/INSTALLATION.md
OS X 10.11 El Capitan: clean install

OS X 10.11 (El Capitan) / Node.js Developer Environment

Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.

Content

@olegakbarov
olegakbarov / functional-utils.js
Last active August 26, 2015 18:54 — forked from bendc/functional-utils.js
A set of pure and immutable ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
@olegakbarov
olegakbarov / postgres-cheatsheet.md
Created December 17, 2015 15:07 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

  • \q: Quit/Exit
  • \c __database__: Connect to a database
@olegakbarov
olegakbarov / 00_destructuring.md
Created January 17, 2016 23:10 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors

import request from 'superagent';
import cheerio from 'cheerio';
import vo from 'vo';
import {readFile} from 'fs';
/**
* An example generator
*/
function *gen(init) {
//confusing because what is stored in `first` variables is not what is returned from
@olegakbarov
olegakbarov / README.md
Created July 12, 2016 19:52 — forked from Dr-Nikson/README.md
Auth example (react + redux + react-router)
@olegakbarov
olegakbarov / nginx.conf
Created November 10, 2016 09:14 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which