Skip to content

Instantly share code, notes, and snippets.

Avatar

Dmitrii 'Mamut' Dimandt dmitriid

View GitHub Profile
@Frikki
Frikki / dialogue.js
Last active Oct 3, 2017
Simple Cycle.js (Nested) Dialogue with MVI Example
View dialogue.js
/** @jsx hJSX */
import {hJSX} from '@cycle/dom';
const DIALOGUE_NAME = `dialogue`;
let idSuffix = 0;
function makeCycleId() {
return `${DIALOGUE_NAME}-${idSuffix++}`;
@axefrog
axefrog / example.js
Last active Sep 8, 2015
Simple logger for my Cycle.js apps. Writes pretty console output and exposes an observable message stream if further processing is desired.
View example.js
import logger from './logger';
let log = logger('Category');
log.trace('Just tracing stuff');
log.debug('Here is a debug message');
log.success('The successful thing happened that we wanted to happen');
log.info('Information makes the world go around, and here is that string:', str);
log('An info message can be logged using short form');
log.warn('You better be careful about this kind of thing');
@willurd
willurd / web-servers.md
Last active Aug 4, 2021
Big list of http static server one-liners
View web-servers.md

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
@maxlapshin
maxlapshin / small_erlang.sh
Last active Dec 17, 2015
Build and clean small server erlang distribution without useless libraries
View small_erlang.sh
#!/bin/bash
[ -f /usr/bin/gcc ] || (apt-get update && apt-get install -y build-essential libncurses-dev libssl-dev chrpath)
#wget http://www.hpl.hp.com/research/linux/atomic_ops/download/libatomic_ops-7.2d.tar.gz
#tar zxf libatomic_ops-7.2d.tar.gz
#cd libatomic_ops-7.2/
#./configure --prefix=/opt/flussonic
#make install
#cd ..
@renatoalbano
renatoalbano / encode_uri_rfc3986.erl
Created Sep 27, 2012
erlang percent encoding that works with utf-8
View encode_uri_rfc3986.erl
-module(encode_uri_rfc3986).
-author('Renato Albano <renatoalbano@gmail.com>').
-export([encode/1]).
%% Taken from <http://erlangexamples.com/>,
%% from <http://github.com/CapnKernul/httparadise>
%% and <http://www.erlang.org/doc/man/edoc_lib.html>
encode([C | Cs]) when C >= $a, C =< $z ->
@andreineculau
andreineculau / jira2branch.sh
Last active Oct 9, 2015
JIRA ticket to branch name
View jira2branch.sh
#!/bin/bash -e
# Usage # copy from browser "JIRA-205\nTicket title"
# $ jira2branch # echoes jira-205-ticket-title
# $ JIRA2BRANCH_TEAM=team jira2branch # echoes jira-205-team-ticket-title
# $ jira2branch team2 # override mode
# echoes jira-205-team2-ticket-title ignoring $JIRA2BRANCH_TEAM
OS=`uname`
@evansolomon
evansolomon / git-completion.sh
Created Apr 1, 2012
Git auto-complete script
View git-completion.sh
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#