Skip to content

Instantly share code, notes, and snippets.

@jahio
jahio / .profile
Created January 3, 2017 11:05
Some useful aliases for installing and working with NixOS
#!/usr/bin/env $SHELL
alias lsblk="lsblk -o MODEL,VENDOR,NAME,LABEL,SIZE,MOUNTPOINT,FSTYPE"
alias gramps="nix-env -p /nix/var/nix/profiles/system --list-generations"
alias nixos-rebuild="nixos-rebuild -j 6 --cores 8"
#
# -j is how many "jobs" or simultaneous computational processes run in tandem
# --cores is how many CPU cores you want to use
# How do you get these values? `cat /proc/cpuinfo` and look at the number of
# returned "CPUs". They're zero indexed, so if you get the last one as object
# number seven (7), you have 8 cores.
@jahio
jahio / osx-disk-utility.md
Last active January 5, 2017 19:48
What OS X's Disk Utility SHOULD Be Able to Do - But It Got Nerfed

Notes on making USB disks from the macOS Console

Since Apple destroyed the awesome tool that was Disk Utility in the pre-Capitan days, we now have to resort to this kind of lunacy to do what used to be a simple task. Way to go, Apple. You're making Microsoft look borderline useful with these kinds of fuck-ups, and I find myself gravitating toward the power, consistency and flexibility I can get with Linux with each passing day. Get your shit together.

...anyway...

tl;dr

@jahio
jahio / settings.json
Created September 14, 2016 14:04
Visual Studio Code - User Settings Overrides
// Place your settings in this file to overwrite the default settings
{
"editor.rulers": [80, 100],
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.mouseWheelZoom": true,
"editor.fontLigatures": true,
"editor.renderIndentGuides": true,
"editor.codeLens": true,
"diffEditor.ignoreTrimWhitespace": false,
@jahio
jahio / snapshots.rb
Created June 29, 2015 22:10
ENV Snapshots for EY Cloud Client
# Assuming you've authenticated with an object named 'api'...
env = (api.environments.select { |x| x.name == "my_uniqe_env_name"}).first
env.snapshots
# big list of all environment snapshots here (array)
#
# See your app master snapshots (array):
env.snapshots.select { |x| x.role == "app_master" }
@jahio
jahio / DefaultKeyBinding.dict
Created September 5, 2015 19:57
Home and End Key Remapping - OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
// Home
"\UF729" = "moveToBeginningOfLine:";
// End
"\UF72B" = "moveToEndOfLine:";
// Shift+Home (highlight from cursor to start of line)
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
@jahio
jahio / riak.conf
Last active February 18, 2016 00:11
riak.conf / dev setup on os x after ulimit tweaks in docs / installed via homebrew
## Where to emit the default log messages (typically at 'info'
## severity):
## off: disabled
## file: the file specified by log.console.file
## console: to standard output (seen when using `riak attach-direct`)
## both: log.console.file and standard out.
##
## Default: file
##
## Acceptable values:
@jahio
jahio / gist:7240249
Last active December 27, 2015 00:49
ruby test inside script
require "test/unit"
class SomeClass
end
if $0 == __FILE__
class SomeClassTestUnit < Test::Unit::TestCase
def test_something
# does something here
/* Remaps the OS X home and end keys on your keyboard to go to the beginning,
and end of the line respectively. Emulates Windows behavior - one of the
few things about Windows I actually liked back in the day.
Put this file in ~/Library/KeyBindings/DefaultKeyBinding.dict. Create the
directory under ~/Library if it doesn't yet exist (~/Library should). Then
put this file in there. Rememebr to re-launch and program/process that you
want to be able to use the new keymaps in. Or just logout and log back in,
or you could reboot but that might be a little overkill.
@jahio
jahio / gist:6073520
Created July 24, 2013 19:10
Typecasting data coming out of hstore
testing=# \d foo
Table "public.foo"
Column | Type | Modifiers
--------+--------+-----------
id | uuid | not null
stuff | hstore |
Indexes:
"foo_pkey" PRIMARY KEY, btree (id)
testing=# SELECT * FROM foo;
@jahio
jahio / .editorconfig
Created September 20, 2015 19:21
My Preferred .editorconfig
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true