Given a single word as input try to find a repeated letter inside of it such that you can loop the text around and reuse that letter. For example:
$ ruby word_loop.rb Mississippi
i
p
p
Mis
ss
si
# If you use the default table name | |
PaperTrail::Version.connection.execute(<<-SQL | |
select k as key, count(*) | |
from versions v cross join lateral | |
jsonb_object_keys(v.object_changes) k | |
group by k order by count(*) desc; | |
SQL | |
).to_a | |
# If your table name is papertrail_versions |
require "active_support" | |
require 'fileutils' | |
def calculate_file_to_write_to(line) | |
parts = line.strip.split ' ' | |
if line.include? 'class:' | |
fname = parts[-2].gsub(',', '') | |
fname.gsub! '/' | |
fname = ActiveSupport::Inflector.underscore fname |
mkdir ~/Documents/Screenshots | |
defaults write com.apple.screencapture location ~/Documents/Screenshots/ | |
killall SystemUIServer |
require 'LIFX' | |
require 'net/http' | |
require 'json' | |
# LIFX setup | |
green = LIFX::Color.green saturation: 1 | |
red = LIFX::Color.red saturation: 1 | |
white = LIFX::Color.white | |
off_color = LIFX::Color.white brightness: 0 |
# Add this to ~/.profile | |
function tabc() { | |
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi # if you have trouble with this, change | |
# "Default" to the name of your default theme | |
echo -e "\033]50;SetProfile=$NAME\a" | |
} | |
function colorssh() { |
EBS optimized r3.xlarge instance with 3.3TB EBS volume attached. | |
###### Write benchmarks ######### | |
sudo dd bs=1M count=2048 if=/dev/zero of=foo oflag=dsync | |
## 16GB EBS System Partition | |
2147483648 bytes (2.1 GB) copied, 51.1244 s, 42.0 MB/s | |
## 75GB Instance Store | |
2147483648 bytes (2.1 GB) copied, 24.5199 s, 87.6 MB/s |
Given a single word as input try to find a repeated letter inside of it such that you can loop the text around and reuse that letter. For example:
$ ruby word_loop.rb Mississippi
i
p
p
Mis
ss
si
mysql -u root -e "GRANT ALL ON flippa.* TO flippa@localhost IDENTIFIED BY 'flippa';" | |
mysql -u root -e "GRANT ALL ON commerce.* TO flippa@localhost IDENTIFIED BY 'flippa';" | |
mysql -u root -e "GRANT ALL ON commerce.* TO commerce@localhost IDENTIFIED BY 'commerce';" | |
mysql -u root -e "CREATE DATABASE flippatest;" | |
mysql -u root -e "GRANT ALL ON flippatest.* TO flippa@localhost IDENTIFIED BY 'flippa';" |
# added to ~/.bashrc | |
stashgrep() { | |
for i in `git stash list --format="%gd"`; do | |
git stash show -p $i | grep -H --label="$i" "$1" | |
done | |
} | |
# usage: | |
# stashgrep zip | |
# returns |
// ==UserScript== | |
// @name G+ Hangouts Autojoin | |
// @description Automatically click the join button when loading a hangout | |
// @include https://plus.google.com/hangouts/_/* | |
// @match https://plus.google.com/hangouts/_/* | |
// @version 0.1.0 | |
// ==/UserScript== | |
(function(){ |