Find it here: https://github.com/bitemyapp/learnhaskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should call mutation properly', async () => { | |
// eslint-disable-next-line | |
const { debug, getByText, getByTestId } = render(<MyComponent />); | |
const customMockResolvers = { | |
...mockResolvers, | |
}; | |
const name = 'myName'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import subprocess | |
times = {} | |
def fmt(s): | |
return f'{s:.2f}s' | |
def test(workers): | |
cmd = f'yarn run test --maxWorkers={workers}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
_UID=$(id -u) | |
GID=$(id -g) | |
# give lxd permission to map your user/group id through | |
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root | |
# set up a separate key to make sure we can log in automatically via ssh | |
# with $HOME mounted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi, | |
Quick and dirty way to get the M-Audio ProjectMix I/O (Firewire) and the M-audio Midiman 2x2 USB MIDI interface to work in Yosemite: | |
1) Unplug the two devices from your mac | |
2) Enable Kernel Extension Developer mode: | |
sudo nvram boot-args="kext-dev-mode=1" | |
3) Reboot |
A great tool is envdir
apt-get install envdir
mkdir /etc/mysite.d/env
echo "postgres://postgres:@localhost:5432/mysite" > /etc/mysite.d/env/DATABASE_URL
echo "s3ce3t K3Y" > /etc/mysite.d/env/SECRET_KEY
echo "/srv/www/mysite/static" > /etc/mysite.d/env/STATIC_ROOT
echo "mysite.settings" > /etc/mysite.d/env/DJANGO_SETTINGS_MODULE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def cds (collection)) | |
;; interact with database | |
(go | |
(>! (:in cds) | |
{:op :create | |
:val {:title "Soft Machine Vol. 1" | |
:artist "Soft Machine" | |
:year 1969}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# ... | |
preprocess do | |
RedirectGenerator.generate(config[:redirects], items) | |
end | |
route '/old_posts/*' do | |
item.identifier.sub('old_posts/', '') + 'index.html' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit: http://richardconroy.blogspot.com/2010/08/capybara-reference.html | |
#Navigating | |
visit('/projects') | |
visit(post_comments_path(post)) | |
#Clicking links and buttons | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use 'backtype.storm.clojure) | |
(use 'backtype.storm.config) | |
(require '[backtype.storm [thrift :as thrift]]) | |
(import 'storm.starter.spout.RandomSentenceSpout) | |
(import 'backtype.storm.LocalCluster) | |
(defboltfull suffix-bolt ["word"] | |
:params [suffix] | |
:let [conf-state (atom nil)] | |
:prepare ([conf context collector] |
NewerOlder