most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
#!/usr/bin/env ruby | |
require 'syslog' | |
require 'net/http' | |
require 'aws-sdk' | |
Syslog.open | |
AWS.config({ | |
:access_key_id => '<iam user key>', | |
:secret_access_key => '<iam user secret>' |
#!/bin/sh | |
# Installation: save to /usr/local/bin/allthethings | |
# and chmod +x /usr/local/bin/allthethings | |
# Usage: allthethings update | |
# allthethings install | |
if [ -f "Gemfile" ]; then | |
echo "bundler" |
exclude_patterns() { | |
exclude="-false" # need to start the list somewhere so we have the right number of "-or" | |
for exclude_folder in .git .bundle tmp log; do | |
exclude="$exclude -or -name $exclude_folder -prune" | |
done | |
for exclude_file in Gemfile.lock structure.sql '*.gif' '*.jpg' '*.png' '*jquery*' '*.doc' '*.pdf' '*.zip' '*.ico' '*.swf' '*.sqlite' '*.ttf'; do | |
exclude="$exclude -or -iname $exclude_file" | |
done |
""" | |
Copies all keys from the source Redis host to the destination Redis host. | |
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are | |
restricted (e.g. on Amazon ElastiCache). | |
The script scans through the keyspace of the given database number and uses | |
a pipeline of DUMP and RESTORE commands to migrate the keys. | |
Requires Redis 2.8.0 or higher. |
class TodoItem < ActiveRecord::Base | |
extend TimeState | |
# Scopes added: finished, not_finished | |
# Instance methods added: finished?, finish! | |
time_state :finished_at | |
end | |
todo_item = TodoItem.create | |
todo_item.finished_at # => nil |
Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.
If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3
HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.
Follow along...
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.