Skip to content

Instantly share code, notes, and snippets.

View agosto-calvinbehling's full-sized avatar

Calvin Behling agosto-calvinbehling

View GitHub Profile
@agosto-calvinbehling
agosto-calvinbehling / gist-gadget.xml
Created November 13, 2015 04:00 — forked from takuya0301/gist-gadget.xml
Google gadget for embedding Gist.
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Gist">
<Require feature="dynamic-height"/>
</ModulePrefs>
<UserPref name="id" display_name="Gist ID" required="true" default_value="9088612"/>
<UserPref name="font_size" display_name="Font size (px)" required="true" default_value="12"/>
<UserPref name="line_height" display_name="Line height (px)" required="true" default_value="16"/>
<Content type="html">
<![CDATA[
@agosto-calvinbehling
agosto-calvinbehling / gopng.go
Last active November 19, 2015 14:21
PNG compression
package main
import (
"fmt"
"image/png"
"os"
)
// DefaultCompression
// NoCompression
@agosto-calvinbehling
agosto-calvinbehling / fix.js
Last active April 13, 2016 19:06
notifications fix cinnamon: /usr/share/cinnamon/js/ui/messageTray.js
_onNotificationExpanded: function() {
let expandedY = this._notification.actor.height - this._notificationBin.height;
// Don't animate the notification to its new position if it has shrunk:
// there will be a very visible "gap" that breaks the illusion.
// This isn't really working at the moment, but it was just crashing before
// if it encountered a critical notification. expandedY is always 0. For now
// just make sure it's not covering the top panel if there is one.
let monitor = Main.layoutManager.primaryMonitor;
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
out log --pretty=oneline --abbrev-commit --graph @{u}..
in !git fetch && git log --pretty=oneline --abbrev-commit --graph ..${1:-@{u}} }
br checkout -b
cd checkout
co checkout
current rev-parse --abbrev-ref HEAD
cur rev-parse --abbrev-ref HEAD
recent !git reflog --date=local | head ${1:-}
graph log --graph --decorate --color --all --topo-order
hash rev-parse HEAD
@agosto-calvinbehling
agosto-calvinbehling / HtmlToJson.py
Last active March 8, 2017 23:07
Random bits of html parser for helping debug
from HTMLParser import HTMLParser
import json
class HtmlToJson(HTMLParser):
"""
Transforms HTML to a simplified JSON format.
"""
def __init__(self, tag_filters):
HTMLParser.__init__(self)
self._records = []