Skip to content

Instantly share code, notes, and snippets.

@FradSer
FradSer / iterm2_switch_automatic.md
Last active May 2, 2024 07:54
Switch iTerm2 color preset automatic base on macOS dark mode.

The latest beta (3.5) includes separate color settings for light & dark mode. Toggling dark mode automatically switches colors.

Vist iTerm2 homepage or use brew install iterm2-beta to download the beta. Thanks @stefanwascoding.


  1. Add switch_automatic.py to ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch with:
@kevinetienne
kevinetienne / loop.go
Created November 6, 2018 09:55
Infinite loop to get data from a source
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
dataChan := make(chan string)
@andyrbell
andyrbell / docker-image-size.sh
Last active September 11, 2022 22:36
Sort docker images by size desc
#!/bin/sh
docker images --format '{{.Size}}\t{{.Repository}}\t{{.Tag}}\t{{.ID}}' | sed 's/ //' | sort -h -r | column -t
@oldwestaction
oldwestaction / tabbycatswag.json
Last active November 11, 2023 01:52
hack for the tabby cat chrome extension to unlock all the accessories
{"collected":["glasses-1","glasses-2","glasses-3","glasses-4","hat-1","hat-2","hat-3","hat-4","hat-5","hat-6","hat-7","hat-8","toy-1","toy-2","toy-3","toy-4","toy-5","toy-6","toy-7","toy-8"],"active":{"hat":"hat-8","toy":"toy-3","glasses":"glasses-3"},"unseen":[],"shuffle":false}
@finscn
finscn / NewFile.py
Created June 19, 2015 07:39
A plugin of SublimeText 3 : Let the FOLDER of a new untitled file be as same as the folder of current activated file.
# NewFileAtCurrentFolder
import sublime_plugin
import os.path
class NewFileListener(sublime_plugin.EventListener):
def on_new_async(self, view):
if not view.window().active_view():
print("NF: no view")
return
@tomyam1
tomyam1 / matchers.js
Last active April 9, 2020 15:02
Custom matchers for Protractor and Jasmine 2
'use strict';
const _ = require('lodash');
const Tinycolor2 = require('tinycolor2');
/**
* Custom matchers for protractor and jasmine 2
*
* expect(el).toBePresent();
* expect(el).toBeDisplayed();
@henrik
henrik / yosemite_upgrade_notes.md
Last active December 30, 2015 02:29
Yosemite upgrade notes

Yosemite upgrade notes

From a (mostly) Ruby on Rails developer.

After doing the below everything seems to work (some of it worked before doing anything), including Ruby, Gems, RVM, Homebrew, VirtualBox/Vagrant VMs, Pow, tmux, git, vim.

  1. Did a full-disk backup that I can restore from
  2. Moved out /usr/local to avoid super slow install, per option 1 in https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/: sudo mv /usr/local ~/local
  3. Upgraded to Yosemite
  4. Restored /usr/local, per option 1 in https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/: sudo mv ~/local /usr
@fpirsch
fpirsch / toHaveClass.js
Created September 30, 2014 14:02
Protractor/jasmine toHaveClass custom matcher
/**
* Custom "toHaveClass" matcher.
*
* Based on https://gist.github.com/darthwade/9305669
* and https://gist.github.com/elgalu/94284ec0ac3e8a590507
*
* usage :
* require('./toHaveClass.js');
* ...
* expect($('html')).toHaveClass('wf-active');
@grahamgilchrist
grahamgilchrist / package.json
Last active August 29, 2015 14:06
Grunt submodule
{
"name": "grunt-my-custom-webfont",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "0.4.1",
"grunt-webfont": "0.4.8",
}
}
@samwhitehall
samwhitehall / pringle.py
Last active October 26, 2016 13:27
Pringle Stack
class PringleStack:
def __init__(self):
self.stack = []
def push(self, obj):
self.stack.append(obj)
def pop(self):
while len(self.stack) > 0:
yield self.stack.pop()