Skip to content

Instantly share code, notes, and snippets.

View andilabs's full-sized avatar
👨‍💻
still in love with coding!

Andrzej Kostanski andilabs

👨‍💻
still in love with coding!
View GitHub Profile
# from https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb
require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sha256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
var materials = [
'Hydrogen',
'Helium',
'Lithium',
'Beryllium'
];
materials.map(function(material) {
return material.length;
}); // [8, 6, 7, 9]
// Parenthesize the body of function to return an object literal expression:
params => ({foo: bar})
// Rest parameters and default parameters are supported
(param1, param2, ...rest) => { statements }
(param1 = defaultValue1, param2, …, paramN = defaultValueN) => { statements }
// Destructuring within the parameter list is also supported
let f = ([a, b] = [1, 2], {x: c} = {x: a + b}) => a + b + c;
f();
@andilabs
andilabs / intro_react.md
Last active September 21, 2017 12:01
react basics
@andilabs
andilabs / kill_psql.sql
Created September 6, 2017 14:48
kill all connections to postgres database
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'YOUR_DATABASE_NAME'
AND pid <> pg_backend_pid();
# Python 3.5.2 (default, Nov 17 2016, 17:05:23)
# Type "copyright", "credits" or "license" for more information.
# IPython 5.3.0 -- An enhanced Interactive Python.
# ? -> Introduction and overview of IPython's features.
# %quickref -> Quick reference.
# help -> Python's own help system.
# object? -> Details about 'object', use 'object??' for extra details.
In [1]: from typing import NamedTuple
@andilabs
andilabs / 0_reuse_code.js
Created August 4, 2016 14:39
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