Skip to content

Instantly share code, notes, and snippets.

@aaronhoffman
aaronhoffman / SpotifyApiController.cs
Created September 14, 2016 17:39
Spotify Web API Auth Example C#
public class SpotifyApiController
{
//see https://developer.spotify.com/web-api/authorization-guide/#client_credentials_flow
public void GetClientCredentialsAuthToken()
{
var spotifyClient = "";
var spotifySecret = "";
var webClient = new WebClient();
@badsyntax
badsyntax / example.bash
Last active December 15, 2016 10:57
SSHFS usage on OSX
# Mount
sshfs richard@10.2.38.156: local_dir/ -o uid=$(id -u) -o gid=$(id -g)
# Unmount
sudo umount -f local_dir/
@gwerbin
gwerbin / uninstall-ghostscript.sh
Last active August 18, 2023 07:52
Uninstall Ghostscript that comes with MacTex.
#!/usr/bin/env bash
# Copyright (c) 2015, 2020, and 2021 by Greg Werbin.
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with
# or without fee is hereby granted, provided that the above copyright notice and this
# permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED “AS IS” AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
# SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT
@czunker
czunker / gist:32d07ced04928d89d527
Last active October 19, 2015 14:36
Call Puppet Agent inside Ansible playbook
- name: Start puppet agent
sudo: yes
shell: /usr/bin/puppet agent --verbose --test
register: puppet_agent_result
changed_when: puppet_agent_result.rc|int == 2
failed_when: puppet_agent_result.rc|int != 2 and puppet_agent_result.rc|int != 0
@bitjockey42
bitjockey42 / mopidy.md
Created April 20, 2014 16:39
An installation and setup guide for mopidy on Arch Linux.

Mopidy on Arch Linux

mopidy

Installation

Install from the AUR.

@jakimowicz
jakimowicz / redmine gitlab sync
Created November 15, 2012 16:22
simple (and dirty) sync between redmine issues and gitlab issues
#!/usr/bin/env ruby
require 'faraday'
require 'json'
require 'gitlab'
module Redmine
Host = nil
APIKey = nil
@jboner
jboner / latency.txt
Last active May 5, 2024 03:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@ChrisWills
ChrisWills / .screenrc-main-example
Created November 3, 2011 17:50
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'