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
#Put this inside ~/.bash_profile | |
#Function for lazy git commiting. | |
#Instead of: git commit -m "some message" | |
#Type: gci some message | |
gci() { | |
if [ -z "$1" ] # Is parameter #1 zero length? | |
then | |
echo "You must pass a commit message like this: gci some message here - which then becomes: git commit -m 'some message here'" | |
else | |
git commit -m "$*" |
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
#!/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
; 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
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
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
#relevant lines in features/support/env.rb | |
Capybara.default_selector = :css | |
Capybara.javascript_driver = :culerity | |
Capybara.ignore_hidden_elements = true | |
#features/hidden_text_testing.feature | |
@javascript | |
Scenario: Testing test hidden via inline style with 'should not see' | |
When I visit the the public index.html page | |
Then I should not see "Hidden Via Comment" |
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 |
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
TUNNELING | |
Expose server port 456 on local port 123 | |
$ ssh -L 123:localhost:456 user@yourserver.com | |
Transparent SOCKS proxy on localhost:12345 | |
$ ssh -D 12345 user@yourserver.com |
NewerOlder