Skip to content

Instantly share code, notes, and snippets.

@jmatsushita
jmatsushita / README
Last active April 28, 2024 14:42
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@bdesham
bdesham / process.awk
Last active March 7, 2024 11:56
Takes a list of commands with timing information and displays the elapsed time for each one.
# Takes a list of commands with timing information and displays the elapsed
# time for each one.
#
# The input is expected to look like
#
# +1518804574.3228740692 colors:76> local k
# +1518804574.3228929043 colors:77> k=44
# +1518804574.3229091167 colors:77> color[${color[$k]}]=44
# +1518804574.3229229450 colors:77> k=33
# +1518804574.3229279518 colors:77> color[${color[$k]}]=33
@henrebotha
henrebotha / instructions.md
Last active March 30, 2024 22:37
Karabiner Elements: Caps Lock + I/J/K/L to Arrow Keys (a la Pok3r)

Instructions

  1. Install Karabiner Elements
  2. Open your karabiner.json file (it will be in ~/.config/karabiner/karabiner.json).
  3. Find complex_modifications. It will have a key rules that takes a list ("rules": [...]).
  4. Inside the square brackets, paste this:
{
    "description": "Change Caps Lock + I/J/K/L to Arrow Keys",
@christiansyoung
christiansyoung / Pokemon.md
Last active August 3, 2016 14:19
Pokemon: Go - ressurser

###Finn ut om din pokemon er verdt å spare på

Pokemon > move set > IV

De beste pokemonene vil være høyt oppe på overall ranking, ha et tilnærmet perfekt moveset og god indivudal value (IV). Er din pokemon verdt å bruke ressurser på? Sjekk moveset og ranking på https://drive.google.com/file/d/0B0TeYGBPiuzaYWhMNV9seWs1emc/view under Simple results (ctrl/cmd + f til du finner din pokemon). Etterpå sjekker du IV på: https://thesilphroad.com/research (IV Rater)

###Charts ####Relevante

@basnijholt
basnijholt / install-fresh-macOS.md
Last active March 17, 2024 03:59
install fresh macOS
@mikaelbr
mikaelbr / README.md
Last active January 3, 2016 01:18
Standard Reveal.js theme with BEKK colors and BEKK logo in the bottom right corner.

BEKK Theme for Reveal.js

A standard Reveal.js theme with BEKK colors and a BEKK logo in the bottom left corner.

Installation

From Reveal.js git clone: Copy bekk.scss to the css/theme/source/ directory.

  1. Install Node.js
  2. Install Grunt
@gonzalo-bulnes
gonzalo-bulnes / XXXXXXXXXXXXX_add_authentication_token_to_users.rb
Last active March 6, 2019 15:15
(Update: I've packaged this gist into a gem to make its use easier, see: https://github.com/gonzalo-bulnes/simple_token_authentication.) Add token authentication to your Rails API. Follows the José Valim recomendations and is fully compatible with Devise (tokens are created the first time users sign in). See https://gist.github.com/josevalim/fb7…
# db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb
class AddAuthenticationTokenToUsers < ActiveRecord::Migration
def change
add_column :users, :authentication_token, :string
add_index :users, :authentication_token, :unique => true
end
end
@mtowers
mtowers / README.md
Last active February 24, 2022 17:19
Google Analytics Website Visitor Count Widget for Dashing with OAuth2 Authentication
@mattetti
mattetti / multipart_upload.go
Last active April 22, 2024 05:24
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@mikeraimondi
mikeraimondi / database_cleaner.rb
Created June 29, 2013 00:25
database_cleaner config for Capybara/RSpec with poltergeist
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = Capybara.current_driver == :rack_test ? :transaction : :truncation
DatabaseCleaner.clean
DatabaseCleaner.start
end