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
cuke() { | |
clear | |
cucumber --drb --tags @dev features/ | |
if [ $? -eq 0 ]; then | |
echo "" | |
echo "" | |
echo "@dev test are fine. Running all the tests." | |
echo "" | |
cucumber --drb features/ | |
if [ $? -eq 0 ]; then |
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 datetime | |
import httplib2 | |
# to see in detail what's going on, uncomment | |
# httplib2.debuglevel = 4 | |
from apiclient.discovery import build | |
from oauth2client.client import OAuth2Credentials, OAuth2WebServerFlow | |
if __name__ == "__main__": |
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
{-# LANGUAGE Arrows #-} | |
import Control.Arrow | |
double :: Int -> Int | |
double x = x * 2 | |
triple :: Int -> Int | |
triple x = x * 3 |
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
module Test.Hspec.JSON | |
( shouldBeJson | |
) where | |
import Control.Monad (when) | |
import Control.Monad.State (StateT, get, modify, runStateT) | |
import Control.Monad.Writer (Writer, execWriter, tell) | |
import Data.ByteString.Lazy (ByteString) | |
import Data.Function (on) | |
import Data.Monoid ((<>)) |
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
package pdfutil; | |
import org.apache.pdfbox.cos.COSArray; | |
import org.apache.pdfbox.cos.COSDictionary; | |
import org.apache.pdfbox.cos.COSName; | |
import org.apache.pdfbox.cos.COSStream; | |
import org.apache.pdfbox.pdmodel.PDDocument; | |
import org.apache.pdfbox.pdmodel.PDDocumentCatalog; | |
import org.apache.pdfbox.pdmodel.PDPage; | |
import org.apache.pdfbox.pdmodel.PDResources; |
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
""" | |
A bare bones examples of optimizing a black-box function (f) using | |
Natural Evolution Strategies (NES), where the parameter distribution is a | |
gaussian of fixed standard deviation. | |
""" | |
import numpy as np | |
np.random.seed(0) | |
# the function we want to optimize |
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 python | |
# vim: set fileencoding=utf-8 | |
# | |
# USAGE: | |
# Back up your tmux old config, run the script and redirect stdout to your conf | |
# file. Example: | |
# | |
# $ cp ~/.tmux.conf ~/.tmux.conf.orig | |
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf | |
# |
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
# ffmpeg -i steep_turn_corrected.MOV -acodec copy -vcodec copy steep_turn_corrected.mp4 | |
# exiftool -ProjectionType="equirectangular" photo.jpg | |
ffmpeg -i hatcher_birthday1.MOV -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate0.ts | |
ffmpeg -i hatcher_birthday2.MOV -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts | |
ffmpeg -i "concat:intermediate0.ts|intermediate1.ts" -c copy -bsf:a aac_adtstoasc hatcher_birthday.mp4 |
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
stats = Sidekiq::Stats.new | |
stats.queues | |
stats.enqueued | |
stats.processed | |
stats.failed |
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 torch | |
from torch import LongTensor | |
from torch.nn import Embedding, LSTM | |
from torch.autograd import Variable | |
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence | |
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium'] | |
# | |
# Step 1: Construct Vocabulary | |
# Step 2: Load indexed data (list of instances, where each instance is list of character indices) |
OlderNewer