Skip to content

Instantly share code, notes, and snippets.

View GarlandRileyJr's full-sized avatar

Garland Riley Jr. GarlandRileyJr

  • Philadelphia, PA
View GitHub Profile
@mikeal
mikeal / r2.js
Last active April 21, 2023 17:13
HTTP Client Comparison
const r2 = require('r2')
let doJsonThing = async (path, propname) => {
let res = await r2(`http://api.com${path}`).json
return res[propname]
}
@adamrecsko
adamrecsko / highlight.pipe.ts
Created May 1, 2016 20:28
Angular2 text highlight pipe
import {PipeTransform, Pipe} from 'angular2/core';
@Pipe({ name: 'highlight' })
export class HighLightPipe implements PipeTransform {
transform(text: string, [search]): string {
return search ? text.replace(new RegExp(search, 'i'), `<span class="highlight">${search}</span>`) : text;
}
}
/** Usage:
@aktau
aktau / imessage
Last active June 11, 2023 20:30
Send iMessage from the commandline
#!/bin/sh
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit
-- another way of waiting until an app is running
on waitUntilRunning(appname, delaytime)
repeat until my appIsRunning(appname)
tell application "Messages" to close window 1
delay delaytime
end repeat
@d3noob
d3noob / .block
Last active May 13, 2020 14:42
Simple d3.js bar chart
license: mit
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet