Skip to content

Instantly share code, notes, and snippets.

View ianloic's full-sized avatar

Ian McKellar ianloic

View GitHub Profile
@ianloic
ianloic / git-prompt.zsh
Created June 25, 2011 19:55
Showing the Git module and status
setopt prompt_subst
autoload colors zsh/terminfo
colors
function __git_prompt {
local DIRTY="%{$fg[yellow]%}"
local CLEAN="%{$fg[green]%}"
local UNMERGED="%{$fg[red]%}"
local RESET="%{$terminfo[sgr0]%}"
git rev-parse --git-dir >& /dev/null
@ianloic
ianloic / desktopsearch.m
Created September 16, 2011 00:46
Tell the Rdio desktop app to search
/* Build this with:
* gcc desktopsearch.m -o desktopsearch -ObjC -framework Cocoa
*/
#include <Cocoa/Cocoa.h>
int main(int argc, char** argv) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (argc == 2) {
@ianloic
ianloic / MainActivity.java
Created January 25, 2012 00:36
Rdio Search Intent Example
package com.rdio.android.test;
import android.app.Activity;
import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
@ianloic
ianloic / gist:3085060
Created July 10, 2012 17:47
Big icon for the currently playing track
% osascript -e 'tell the app "Rdio" to get the rdio url of the current
/artist/Green_Day/album/1039/Smoothed_Out_Slappy_Hours/track/I_Was_There/
Then ask the "rest" API for the bigIcon associated w/ that URL, for example see:
http://rdioconsole.appspot.com/#url%3D%252Fartist%252FGreen_Day%252Falbum%252F1039%252FSmoothed_Out_Slappy_Hours%252Ftrack%252FI_Was_There%252F%26extras%3DbigIcon%26method%3DgetObjectFromUrl
@ianloic
ianloic / reused.py
Created November 26, 2016 19:23
Password Reuse Checker
#!/usr/bin/env python3
import argparse
import sys
import datetime
import secretstorage
import functools
def datetime_from_ss(ts):
MAGENTA KERNEL PANIC
GIT REVISION 6082d6775a873f1e91fbf4568b12b386b96e0e08
panic (caller 0xffffffff80134da1 frame 0xffffff804da13420): DEBUG ASSERT FAILED at (kernel/lib/magenta/process_dispatcher.cpp:1
82): state_ == State::RUNNING
platform_halt suggested_action 0 reason 9
Halting...
bt#00: 0xffffffff801522b8
Trying 192.168.3.53...
Connected to 192.168.3.53.
Escape character is '^]'.
^[[68;1R
$
^[[68;1R
$
^[[68;1Rls
$ ls
d 0 .
#autoload
# Hack to replace _path_files with one that expands // and then calls the
# original.
local fdir ffile original found_one
# Look for the second _path_files in the $fpath
for fdir in $fpath; do
ffile=$fdir/$0
#include <utility>
#include <iostream>
#include <atomic>
#include <set>
class OnceWatcher {
public:
virtual void Called() = 0;
};
@ianloic
ianloic / gist:38b267c05d49b6a71a80f65b75b089d1
Created March 29, 2017 04:17
cowsay as a service over ssh
% ssh -o RequestTTY=no [email protected] hello world
______________
| hello world |
--------------
\ ^__^
\ (oo)\_____
(__)\ )\/\
||----w |
|| ||