Skip to content

Instantly share code, notes, and snippets.

@datchley
datchley / react-redux-style-guide.md
Last active March 22, 2025 20:06
React + Redux Style Guide
@ziadoz
ziadoz / install.sh
Last active July 18, 2025 01:46
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@eiriklv
eiriklv / main.js
Last active October 25, 2016 21:41
Handling effects declaratively with generators and custom runtimes (fun and learning inspired by redux-saga - but for broader use)
'use strict';
const { createStore, applyMiddleware } = require('./redux');
const { addActionTakersToStore, addLoggingToStore } = require('./middleware');
const { EventEmitter } = require('events');
const {
isPromise,
isFunction,
isObject,
@eiriklv
eiriklv / effects-and-descriptions.js
Last active October 21, 2016 14:25
Wrapping effects to make non-deterministic/non-pure function testable and predictable (for fun and learning)
'use strict';
/**
* Dependencies
*/
const expect = require('expect');
/**
* Factory for creating an effects handling "runtime"
* that stores a retrievable effects log
@whophil
whophil / jupyter.service
Last active October 8, 2024 00:42 — forked from doowon/jupyter_systemd
A systemd script for running a Jupyter notebook server.
# After Ubuntu 16.04, Systemd becomes the default.
# It is simpler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config=/home/phil/.jupyter/jupyter_notebook_config.py
@viksit
viksit / async_flask.py
Created March 28, 2016 20:01 — forked from sergray/async_flask.py
Asynchronous requests in Flask with gevent
"""Asynchronous requests in Flask with gevent"""
from time import time
from flask import Flask, Response
from gevent.pywsgi import WSGIServer
from gevent import monkey
import requests
@NamPNQ
NamPNQ / .gitconfig
Created February 17, 2016 06:33 — forked from ViktorStiskala/.gitconfig
Pycharm as a default git difftool and git mergetool. Add the following to ~/.gitconfig
[diff]
tool = pycharm
[difftool "pycharm"]
cmd = /usr/local/bin/charm diff "$LOCAL" "$REMOTE" && echo "Press enter to continue..." && read
[merge]
tool = pycharm
keepBackup = false
[mergetool "pycharm"]
cmd = /usr/local/bin/charm merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
@xgrommx
xgrommx / ranges.js
Last active June 13, 2020 23:04
Generate ranges in javascript
const range1 = len => Object.keys(new Int8Array(len)).map(parseFloat);
const range2 = len => Array.apply(null, {length: len}).map(Number.call, Number);
const range3 = (start, end) => Array.apply(null, Array(end - start)).map((_, i) => start + i);
const range4 = (start, end) => [...Array(end - start)].map((_, i) => start + i);
const range5 = len => Object.keys(Array.apply(null, Array(len)));
@mivade
mivade / app.py
Last active May 4, 2023 16:51
Websockets with Flask via aiohttp
"""Simple demo of using Flask with aiohttp via aiohttp-wsgi's
WSGIHandler.
"""
import asyncio
from aiohttp import web
from aiohttp_wsgi import WSGIHandler
from flask import Flask, render_template
@alexpchin
alexpchin / socket-cheatsheet.js
Created December 15, 2015 16:58
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender