Skip to content

Instantly share code, notes, and snippets.

@frane
frane / gh_jobs.sh
Last active March 9, 2021 12:13
GitHub CLI command (alias) to list recent GitHub Action jobs.
# install gh (https://cli.github.com), install jq (https://stedolan.github.io/jq/), then run
gh alias set --shell jobs "gh api /repos/:owner/:repo/actions/runs | jq '(\"Name\" + \" \" * 20)[:20] + \" | \" + (\"Commit\" + \" \" * 50)[:50] + \" | \" + (\"Status\" + \" \" * 20)[:10] + \" | Time \", (.workflow_runs[] | (.name + \" \" * 20)[:20] + \" | \" + (.head_commit.message + \" \" * 100)[:50] + \" | \" + (.status + \" \" * 20)[:10] + \" | \" + .updated_at)' | sed 's/\"//g'"
# in a GitHub repo run
gh jobs
# to se the most recent jobs and statuses
@frane
frane / dabblet.css
Created October 22, 2012 23:57 — forked from anonymous/dabblet.css
Diagonal stripes
/**
* Diagonal stripes
*/
@import url(http://fonts.googleapis.com/css?family=Cabin+Sketch);
.button {
background: repeating-linear-gradient(150deg, white, white 2px, #08b 1px, #08b 3px);
display: inline-block;
border: 1px solid transparent;
@frane
frane / dabblet.css
Created October 21, 2012 02:11
Cashdio
/**
* Cashdio
*/
@import url(http://fonts.googleapis.com/css?family=Cabin+Sketch);
.button {
background: repeating-linear-gradient(150deg, white, white 2px, #08b 1px, #08b 3px);
display: inline-block;
border: 1px solid transparent;
@frane
frane / transparentEmboss.coffee
Created February 15, 2012 17:32
Makes a transparent emboss effect from a given image. Returns both, the original and embossed image. Useful for mouseover effects...
makeTransparentEmboss = (img) ->
canvas = document.createElement("canvas")
return [null, null] unless canvas.getContext
canvas.width = img.width
canvas.height = img.height
ctx = canvas.getContext("2d")
ctx.drawImage(img, 0, 0)
@frane
frane / ArrayObjectDemo.coffee
Created December 31, 2011 02:19
Traversing arrays and objects in CoffeeScript
# Traversing arrays and objects in CoffeeScript
# The array and object we use for testing
arr = [1, 2, 3, 4, 5]
obj = {a: 1, b: 2, c: 3, d: 4, e: 5}
# 'in' has a different meaning in CoffeeScript than in JavaScript
# CS: element in array -> JS: array.indexOf(element) >= 0
console.log '5 in arr: ' + (5 in arr)