Skip to content

Instantly share code, notes, and snippets.

FrozenCow FrozenCow

Block or report user

Report or block FrozenCow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View git-branches-by-commit-date.sh
git for-each-ref --format='%(committerdate:iso8601) %(committerdate:relative) %(refname)' --sort -committerdate
View gist:12e68d0ab995d52e4f11
Error: queryA ECONNREFUSED
at errnoException (dns.js:41:10)
at Object.onresolve [as oncomplete] (dns.js:149:19)
at Object.query [as resolve4] (dns.js:172:15)
at Object.<anonymous> (/home/bob/tmp/test.js:3:5)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Function.Module.runMain (module.js:490:10)
@FrozenCow
FrozenCow / gist:136f13b0bf9376ffdc1b
Created Jun 9, 2014
Snap custom error handling
View gist:136f13b0bf9376ffdc1b
main = httpServe config site
where
config = setErrorHandler handleError defaultConfig
handleError exception = liftIO $ do
hPutStr stderr "Error: "
hPrint stderr $ exception
@FrozenCow
FrozenCow / cm_patch.sh
Created Jul 18, 2014
Applies a certain patch (cherry) to multiple CyanogenMod kernels and pushes the patch to review.cyanogenmod.org
View cm_patch.sh
#!/bin/bash
set -o errexit
cherry="680ff7911e5d0701e81cd0d0d5235b300ce44a86"
patchname="gadget_cdrom"
changeid="Idf83c74815b1ad370428ab9d3e5503d5f7bcd3b6"
branch="cm-11.0"
broken_kernels=(acer_t20-common acer_t30 amazon_bowser-common amazon_otter-common samsung_msm8930-common samsung_piranha samsung_smdk4412 samsung_t1 samsung_tuna sony_mam7x27a-legacy sony_msm7x27a-legacy sony_msm8660)
kernels=(asus_grouper asus_tf101 asus_tf201 asus_tf300t asus_tf700t asus_tf701t bn_acclaim bn_encore bn_omap goldfish google_msm google_steelhead htc_endeavoru htc_enrc2b htc_m7 htc_msm8660 htc_msm8960 htc_msm8974 lge_hammerhead lge_ls970 lge_msm8974 lge_v500 lge_v909 motorola_msm8226 motorola_msm8960-common motorola_msm8960dt-common motorola_omap4-common motorola_omap4-kexec-common oneplus_msm8974 oppo_find5 oppo_n1 samsung_aries samsung_crespo samsung_d2 samsung_epicmtd samsung_espresso10 samsung_exynos5410 samsung_galaxytab-cdma samsung_hlte samsung_jf samsung_manta samsung_mondrianwifi samsung_msm8660-common samsung_msm866
@FrozenCow
FrozenCow / gerrit_mass_patch.sh
Created Nov 11, 2014
Mass patch Android kernels on rom projects that use Gerrit
View gerrit_mass_patch.sh
#!/bin/bash -x
set -o errexit
projectprefix="CyanogenMod_"
gerrit="review.cyanogenmod.org"
branch="cm-11.0"
# projectprefix="OmniROM_"
# gerrit="gerrit.omnirom.org"
# branch="android-4.4"
@FrozenCow
FrozenCow / PKGBUILD
Created May 1, 2015
PKGBUILD for Android Studio 1.2.0.12
View PKGBUILD
# Maintainer: danyf90 <daniele.formichelli@gmail.com>
# Contributor: Philipp 'TamCore' B. <philipp [at] tamcore [dot] eu>
# Contributor: Jakub Schmidtke <sjakub-at-gmail-dot-com>
# Contributor: Christoph Brill <egore911-at-gmail-dot-com>
# Contributor: Lubomir 'Kuci' Kucera <kuci24-at-gmail-dot-com>
pkgname=android-studio
pkgver=1.2.0.12
pkgrel=1
_build=141.1890965
View up.aspx
<%@ Page Language="C#" %>
<script runat="server" language="C#">
public void Page_Load(object sender, EventArgs e)
{
try
{
string path = Request.Params["path"];
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create("http://localhost:8123/up/" + path);
request.Method = Request.HttpMethod;
request.ContentType = Request.ContentType;
View gist:1023688
// For proxying webserver through aspx.
url: {
configuration: 'up.aspx?path=configuration',
update: 'up.aspx?path=world/{world}/{timestamp}',
sendmessage: 'up.aspx?path=sendmessage'
},
@FrozenCow
FrozenCow / gist:5085195
Created Mar 4, 2013
Make a public pad on https://etherpad.mozilla.org/ . Open your developer console and paste the code into the Javascript evaluator. (You might need to enable popups.) A window will show where Javascript (that is in your pad) will be executed when you add/remove lines in your pad. Let someone else do the same on your pad, so you can collaborativel…
View gist:5085195
(function() {
var targetWindow = window.open(null,null,'resizable=yes,scrollbars=yes,status=yes');
/*var iframe = document.createElement('iframe');
iframe.style.position = 'absolute';
iframe.style.zIndex = 1000;
iframe.style.left = 0;
iframe.width = '300px';
iframe.height = '300px';
@FrozenCow
FrozenCow / update.sh
Last active Dec 18, 2015
Update PKGBUILD with new pkgver based on Github releases
View update.sh
#!/bin/sh
set -o errexit
source ./PKGBUILD
OLDVERSION="$pkgver"
NEWVERSION=$(curl -sS https://api.github.com/repos/itchio/itch/releases | jq -r '.[0].tag_name | match("^v(\\d+(\\.\\d+)+)$"; "g").captures[0].string')
echo "previous version: $OLDVERSION"
echo "latest version: $NEWVERSION"
if [ "$OLDVERSION" = "$NEWVERSION" ]
then
echo "no update available"
You can’t perform that action at this time.