Skip to content

Instantly share code, notes, and snippets.

@fabiofl
fabiofl / gist:5873100
Created June 27, 2013 00:41
Clear Mac OS X's icon cache.
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
@gabe565
gabe565 / change-arc-icon.md
Last active May 2, 2024 03:12
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy
@simX
simX / addcontact
Created February 10, 2012 23:21
Add contact command line program
#!/bin/bash
osascript -e "tell application \"Address Book\"" \
-e " set firstParam to \"$1\"" \
-e " set secondParam to \"$2\"" \
-e " set thirdParam to \"$3\"" \
-e " set fourthParam to \"$4\"" \
-e " set contactEmailLabel to \"\"" \
-e " set spaceOffset to (offset of \" \" in firstParam)" \
-e " if (spaceOffset is not equal to 0) then" \
-e " set AppleScript's text item delimiters to \" \"" \
@simX
simX / export_notes
Created March 14, 2013 23:19
Quick AppleScript to export all your notes from Apple's built-in Notes.app application
tell application "Notes"
set note_body_list to (get body of every note)
end tell
set note_count to (count of note_body_list)
set blah_folder to choose folder
set blah_path to POSIX path of blah_folder
repeat with i from 1 to note_count
set filename_string to ((blah_path & "note" & (i as string) & ".html") as text)
func testReservationListPositions() {
let moc = CoreDataStack.sharedStack().mainObjectContext
let reservationListVC = ReservationListViewController()
do {
let reservation1 = try ReservationFactory.generateWithTemplate(ReservationFactory.Template(), parentContext: moc)
} catch {
print(error)
}
@sebmarkbage
sebmarkbage / Infrastructure.js
Last active May 2, 2024 03:11
SynchronousAsync.js
let cache = new Map();
let pending = new Map();
function fetchTextSync(url) {
if (cache.has(url)) {
return cache.get(url);
}
if (pending.has(url)) {
throw pending.get(url);
}
@turingbirds
turingbirds / GNUPG Cheatsheet.md
Last active May 2, 2024 03:11
GPG (GNUPG) Cheatsheet

GNUPG CHEATSHEET

Setting up: key generation

This generates a public/private keypair.

$ gpg --gen-key

$ gpg --list-secret-keys

@nilsandrey
nilsandrey / String.format.js
Last active May 2, 2024 03:10
string.format in Javascript.
// <https://stackoverflow.com/a/4673436/2100126>
// First, checks if it isn't implemented yet.
if (!String.prototype.format) {
String.prototype.format = function() {
var args = arguments;
return this.replace(/{(\d+)}/g, function(match, number) {
return typeof args[number] != 'undefined'
? args[number]
: match
;
@matsuken92
matsuken92 / 01_preparation.py
Last active May 2, 2024 03:08
ROC Curve Animation
%matplotlib inline
import sys
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as st
from matplotlib import animation as ani
import sklearn.metrics as mt
@nilsandrey
nilsandrey / SendToTypefull-bookmarklet.js
Last active May 2, 2024 03:08
Use this code on a new bookmark to send current page to a new Typefully draft.
javascript:(function(){f='https://typefully.com/?new='+encodeURIComponent(document.title)+'%250A'+encodeURIComponent(window.location.href);a=function(){if(!window.open(f))location.href=f};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()