Skip to content

Instantly share code, notes, and snippets.

View evenfrost's full-sized avatar

Aliaksei Kislou evenfrost

View GitHub Profile
@ryanflorence
ryanflorence / static_server.js
Last active July 21, 2024 12:43
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
-accesscode -
-batterytestmode - rapidly cycle battery percentages for testing
-bigpicture - Start in Steam Big Picture mode
-browser-offline -
-cafeapplaunch - Launch apps in a cyber cafe context
-candidates - Show libjingle candidates for local connection as they are processed
-ccsyntax - Spew details about the localized strings we load
-cef-allow-browser-underlay - Allow webhelper to create BrowserView underlays
-cef-delaypageload - Enable early-out for known page loads
-cef-disable-breakpad - disables breakpad in crash dumps
@staltz
staltz / introrx.md
Last active November 14, 2024 11:27
The introduction to Reactive Programming you've been missing
@nolanlawson
nolanlawson / protips.js
Last active August 22, 2024 14:19
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@iofjuupasli
iofjuupasli / async-in-js.md
Last active August 29, 2015 14:26
async graphs in js

Comparison of several ways of working with complex async graphs in js

  A     E
 /|\    |
B | C   F
 \|/
  D
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active August 8, 2024 11:53
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@apolloclark
apolloclark / postgres cheatsheet.md
Last active November 15, 2024 05:23
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@khanghoang
khanghoang / shipitfile.js
Created November 8, 2015 09:15
ShipIt demo config file
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
shipit.initConfig({
default: {
workspace: '../shipit-temp-folder',
deployTo: '~/express4-es6',
branch: "shipit",
repositoryUrl: 'https://github.com/khanghoang/express4-es6.git',
ignores: ['.git', 'node_modules'],
@subhaze
subhaze / JavaScript NG.sublime-syntax
Last active September 29, 2023 14:58
very start of Angular 2 sublime syntax file
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: JavaScript NG
file_extensions:
- js
- ng.js
scope: source.js.ng
contexts:
main:
@tabrindle
tabrindle / webp-convert-directory.sh
Last active November 4, 2024 10:24
Convert all files in directory to webp, with default params, or standard cwebp params passed from command
#!/bin/bash
PARAMS=('-m 6 -q 70 -mt -af -progress')
if [ $# -ne 0 ]; then
PARAMS=$@;
fi
cd $(pwd)