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/python3 | |
# MIT License | |
# | |
# Copyright (c) 2017 Marcel de Vries | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
Here's a repro: | |
1. Visit https://nycdemo152.auth.us-east-1.amazoncognito.com/login?response_type=token&client_id=1o72223p0ont9u6ctbdus5svsu&redirect_uri=https://aws.amazon.com/cognito/ | |
2. Click on 'Continue with Facebook' |
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 | |
require 'curses' | |
include Curses | |
include Curses::Key | |
class Fixnum | |
def clamp(low, high) | |
v = self | |
v = low if self < low |
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 Main exposing (..) | |
import Html exposing (..) | |
import Html.App as Html | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (onInput, onClick) | |
import List exposing (..) | |
import String exposing (..) | |
import Char exposing (..) |
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
(defn fizz-buzz-n | |
[n] | |
(or | |
(and (zero? (mod n 15)) "FizzBuzz") | |
(and (zero? (mod n 3)) "Fizz") | |
(and (zero? (mod n 5)) "Buzz") | |
n)) | |
(println (clojure.string/join "\n" | |
(->> (take 25 (iterate inc 1)) |
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
require 'ostruct' | |
def thing | |
OpenStruct.new(foo: 'FOO') | |
end | |
context 'foo' do | |
it 'returns foo' do | |
expect(thing.foo).to eq('FOO') | |
end |
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
# Substitute path/version of hadoop files below | |
# Note: this will create a directory ./build/test/data/dfs/ to store your HDFS file system in. Clean this up when you're done. | |
HADOOP_CLASSPATH=/usr/local/Cellar/hadoop/2.4.0/libexec/share/hadoop/yarn/test/hadoop-yarn-server-tests-2.4.0-tests.jar hadoop jar /usr/local/Cellar/hadoop/2.4.0/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.4.0-tests.jar minicluster --nnport=8020 |
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
; Sequences | |
;-------------------------------------------------- | |
; Write a function to find out if a string is a palindrome–that is, if it looks the same forwards and backwards. | |
(defn revStr | |
"Reverses s and returns as a string" | |
[s] | |
(apply str (reverse s))) | |
(defn palindrome? |
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
# Show the percentage of similar lines between files. | |
# Requires: diffy gem | |
# Usage: Edit line 33 to match the files you're interested in, then run this script. | |
require 'rubygems' | |
require 'diffy' | |
def get_dup_lines_percentage(file1, file2) | |
starts_with_minus = /^-.*/ |
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
" If you use Vim, and tmux, you should be using Vimux: https://github.com/benmills/vimux | |
" This snippet will let you easily zoom Vimux's runner pane to fullscreen. | |
" It's really helpful for seeing more of a stack trace. | |
" Requires tmux >= 1.8 | |
" Function to tell Vimux to have make tmux zoom its runner pane. | |
function! VimuxZoomRunner() | |
call VimuxInspectRunner() | |
call system("tmux resize-pane -Z") | |
endfunction |
NewerOlder