Skip to content

Instantly share code, notes, and snippets.

@jlroettger
jlroettger / ReorderableList.js
Created August 30, 2016 00:53
React DND and Material UI - Reorderable List
import React, { Component } from 'react'
import { Link } from 'react-router'
// Drag and Drop
import { DragDropContext } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
// Material UI
import { List } from 'material-ui/List'
import Subheader from 'material-ui/Subheader'
class ReorderableList extends Component {
@koemeet
koemeet / Vagrantfile
Last active May 8, 2016 10:42
Vagrant setup for docker (Mac + Win supported)
# UI Object for console interactions.
@ui = Vagrant::UI::Colored.new
# Install required plugins if not present.
required_plugins = ["vagrant-triggers", "vagrant-gatling-rsync"]
required_plugins.each do |plugin|
need_restart = false
unless Vagrant.has_plugin? plugin
system "vagrant plugin install #{plugin}"
need_restart = true
(ns shell
(:require [me.raynes.conch.low-level :as sh]
[slingshot.slingshot :refer [throw+ try+]]
[clojure.core.async :refer [go alts!!]]
[clojure.string :as str])
(:import (java.io IOException StringWriter)
(java.util.concurrent ExecutionException)))
(defn start-step! [upstream step]
(let [prev-step (-> upstream last)
@algotrader-dotcom
algotrader-dotcom / Selenium webdriver wait for ajax with Python
Created December 10, 2015 06:05
Selenium webdriver wait for ajax with Python
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import WebDriverException
def ajax_complete(driver):
try:
return 0 == driver.execute_script("return jQuery.active")
except WebDriverException:
pass
@karlkranich
karlkranich / apitest.php
Last active July 17, 2018 14:49
Updated PHP code to use the Google Sheets API. See usage instructions at http://karl.kranich.org/2015/04/16/google-sheets-api-php/ More examples at https://gist.github.com/karlkranich/afa39e3d778455b38c38
<?php
// apitest.php
// by Karl Kranich - karl.kranich.org
// version 3.1 - edited query section
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php');
include_once "google-api-php-client/examples/templates/base.php";
$client = new Google_Client();
@apolloclark
apolloclark / postgres cheatsheet.md
Last active March 7, 2024 13:53
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

@shaunlebron
shaunlebron / es7coreasync.md
Last active July 28, 2018 07:58
es7 vs core.async

Comparing ES7 and core.async

ES7 core.async
async function() {...} (fn [] (go ...))
await ... (<! ...)
await* or Promise.all(...) (doseq [c ...] (<! c))
@bostonou
bostonou / promise.cljs
Created July 14, 2015 01:14
Promise.all with core.async
(ns cljs-made-easy.core
(:refer-clojure :exclude [into])
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [cljs.core.async :refer [<! >!] :as a]))
(enable-console-print!)
(defn resolving-promise [key t reject]
(go
(pr (str key " starting"))
@scttnlsn
scttnlsn / core.cljs
Created July 1, 2015 17:58
Reagent/Secretary nested routing
(ns nested-routing.core
(:require [goog.events :as events]
[goog.history.EventType :as EventType]
[reagent.core :as reagent]
[reagent.ratom :refer-macros [reaction]]
[re-frame.core :refer [dispatch dispatch-sync register-handler register-sub subscribe]]
[secretary.core :as secretary :refer-macros [defroute]])
(:import goog.History))
(declare route-components