git config --global push.default current
git config --global merge.defaultToUpstream true
git config --global branch.autosetupmerge true
git config --global branch.autosetuprebase remote
git config --global alias.cb 'checkout -b'
git config --global alias.ps 'push -u'
git config --global alias.pl '!git fetch -p && git rebase'
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
use std::collections::HashMap; | |
use std::env; | |
use std::fs::File; | |
use std::io::{Read, Write}; | |
fn predefined_symbols() -> HashMap<&'static str, u16> { | |
let mut symbols: HashMap<&str, u16> = HashMap::new(); | |
symbols.insert("SP", 0); | |
symbols.insert("LCL", 1); | |
symbols.insert("ARG", 2); |
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
-- create a table to track failed MFA verification attempts | |
create table if not exists hub_admin.mfa_failed_verification_attempts( | |
user_id uuid not null references auth.users(id) on delete cascade | |
, factor_id uuid not null | |
, failed_at timestamp with time zone not null default now() | |
, deleted_at timestamp with time zone | |
); | |
create index if not exists idx_mfa_failed_verification_attempts_user_id on hub_admin.mfa_failed_verification_attempts(user_id); | |
-- a database function that takes a jsonb event and returns a jsonb response |
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
javascript: | |
!(() => document.querySelectorAll('.easy-card-list').length < 1 | |
? window.alert('EasyRetro board columns not found') | |
: (() => { | |
/* show all the comments first */ | |
document.querySelectorAll('[aria-label="New comment"]').forEach(el => el.click()); | |
navigator.clipboard.writeText( | |
[...document.querySelectorAll('.easy-card-list')] | |
/* for each column: get column header */ | |
.map(l => [`# ${l.querySelector('.column-header').textContent.trim()}\n`] |
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
git log --pretty=oneline --abbrev-commit | awk '{print length() "\t" $1 }' | sort -rn | head -n 10 |
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 bash | |
#################################################################################### | |
# Slack Bash console script for sending messages. | |
#################################################################################### | |
# Installation | |
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack | |
# $ chmod +x /usr/bin/slack | |
#################################################################################### | |
# USAGE | |
# Send message to slack channel/user |
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 "spec_helper" | |
NATION = "my-nation" | |
EMAIL = "admin@example.com" | |
PASSWORD = "Password1" | |
TAG_PATTERNS_TO_DELETE = [ | |
/^mass_tag_/, | |
/^valuable_member_/, | |
] |
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 'optparse' | |
options = {:subdomain => 'defaultdomain', :port => 3000} | |
parser = OptionParser.new do|opts| | |
opts.banner = "Usage: localtunnel [options]" | |
opts.on('-s', '--subdomain subdomain', 'Subdomain') do |subdomain| | |
options[:subdomain] = subdomain; |
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
~/projects$ h run bash | |
Running `bash` attached to terminal... up, run.2192 | |
~ $ uname -a | |
Linux 7fa29fb1-2e9c-4510-a0a7-df92cfaff4c8 3.8.11-ec2 #1 SMP Fri May 3 09:11:15 UTC 2013 x86_64 GNU/Linux | |
~ $ free -m | |
total used free shared buffers cached | |
Mem: 34302 29994 4307 0 1927 8232 | |
-/+ buffers/cache: 19835 14466 | |
Swap: 34815 732 34083 |
This is a quick way to Push or Pull your app database between your local machine and your Ninefold app server. "Pushing" is useful in the early stages of app development when you need to update seed data. "Pulling" is eternally useful for debugging.
-
setup public key authentication (the SSH username is "user"). NB ensure you don't remove the existing SSH key - it's needed by the Ninefold Portal.
-
obtain your database password from the "database" tab in the Ninefold portal.
-
put the password where Postgres can find it (on the database server):
echo "localhost:*:*:app:<PASSWORD>" > ~/.pgpass
thenchmod 0600 .pgpass
more info on password files
NewerOlder