Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
| There are lots of ways to select a random record or row from a database table. Here are some example SQL statements that don't require additional application logic, but each database server requires different SQL syntax. | |
| Select a random row with MySQL: | |
| SELECT column FROM table | |
| ORDER BY RAND() | |
| LIMIT 1 | |
| Select a random row with PostgreSQL: | |
| SELECT column FROM table |
| #!/bin/bash | |
| rm -f content | |
| rm *.enc | |
| rm *.pem | |
| rm keyfile | |
| rm *.b64 | |
| rm *.dec | |
| echo "generate: data-key for this content transfer" |
| #setup dotfiles using a git bare repo, as per https://news.ycombinator.com/item?id=11071754 | |
| git init --bare $HOME/.dotfiles | |
| alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' | |
| dotfiles config --local status.showUntrackedFiles no | |
| echo "alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.aliases |
| #!/usr/bin/env zsh | |
| #echo "This script depends on correctly configured aws credentials file. \n1. profile, \n2. dest_profile, contains role_arn in dest_account and refers creds to the source_profile, \n3. source_profile contains sts temporary credentials" | |
| echo "1. Authenticate with current AWS_PROFILE (${AWS_PROFILE}) - please provide your account Id and iam username and your MFA token" | |
| echo "2. Assume role as configured in ~/aws/.credentials#${DEST_PROFILE=DEST_PFOFILE}" | |
| if [ -z `which jq` ]; then | |
| echo "ERROR: required command:'jq' command line JSON processor - https://github.com/stedolan/jq" | |
| exit 1 | |
| fi |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "AllowIndividualUserToSeeAndManageTheirOwnAccountInformation", | |
| "Effect": "Allow", | |
| "Action": [ | |
| "iam:ChangePassword", | |
| "iam:CreateAccessKey", | |
| "iam:CreateLoginProfile", |
| #! /usr/bin/env python | |
| import json | |
| import datetime | |
| import httplib2 | |
| import re | |
| import csv | |
| import sys | |
| http = httplib2.Http() |
| (defun epoch-to-iso () | |
| (interactive) | |
| (re-search-forward "\\([0-9]\\{10,13\\}\\)") | |
| (goto-char (match-beginning 0)) | |
| (replace-match (format-time-string "%Y-%m-%d" (seconds-to-time (/ (string-to-int (match-string 1)) 1000)))) | |
| ) | |
| (defun curl-something (begin end) | |
| (interactive "r") | |
| (shell-command (concat "curl " (buffer-substring begin end)))) |
| https://www.grc.com/haystack.htm | |
| http://rumkin.com/tools/password/passchk.php | |
| http://readablepassphrase.codeplex.com/ |