Skip to content

Instantly share code, notes, and snippets.

View k9ordon's full-sized avatar
🐙

Klemens Gordon k9ordon

🐙
View GitHub Profile
@CapyTheBeara
CapyTheBeara / gapi.js
Last active August 29, 2015 13:57
An Ember object to send Google Drive API requests
// Created this object to facilitate an Ember Data Adapter
// Usage:
g = Gapi.create();
// create a file with just meta data (no content)
g.insert({ title: 'first' });
// create a file with content
g.insert({ title: 'second', content: 'second content'});
@seriema
seriema / README
Last active August 29, 2015 13:59 — forked from rwest/README
These two files should help you to import passwords from mac OS X keychains to 1password.
Assumptions:
1) You have some experience with scripting/are a power-user. These scripts worked for me
but they haven't been extensively tested and if they don't work, you're on your own!
Please read this whole document before starting this process. If any of it seems
incomprehensible/frightening/over your head please do not use these scripts. You will
probably do something Very Bad and I wouldn't want that.
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they
@cbeier
cbeier / detect_cleartype.js
Created January 22, 2010 11:08
detect ClearType using javascript
/*
* TypeHelpers version 1.0
* Zoltan Hawryluk, Nov 24 2009.
* @see http://www.useragentman.com/blog/2009/11/29/how-to-detect-font-smoothing-using-javascript/
*
* Released under the MIT License. http://www.opensource.org/licenses/mit-license.php
*
* Works for
* - IE6+ (Windows),
* - Firefox 3.5+ (Windows, Mac, Linux),
@statico
statico / chromium_updater.sh
Created November 12, 2012 20:01
Automatically download Chromium nightly builds
#!/bin/bash
#
# Originally from "Automatically download Chromium nightly builds"
# http://top-frog.com/2010/05/29/automatically-download-chromium-nightly-builds/
LATEST=`curl -s http://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/LAST_CHANGE`
CURRENT=`defaults read /Applications/Chromium.app/Contents/Info SVNRevision 2>/dev/null`
PROCESSID=`ps ux | awk '/Chromium/ && !/awk/ {print $2}'`
if [[ $LATEST -eq $CURRENT ]]; then
@muhqu
muhqu / marked
Last active December 18, 2015 19:09
#!/bin/bash
/usr/local/bin/marked "$@" \
| sed \
-e 's!\[\ \]!<input type="checkbox" onclick="return false" onkeydown="return false">!' \
-e 's!\[[.\-]\]!<input type="checkbox" onclick="return false" onkeydown="return false" indeterminate>!' \
-e 's!\[[√xX]\]!<input type="checkbox" onclick="return false" onkeydown="return false" checked>!' \
| awk '{print;if($0~/indeterminate/)found=1;}END{if(found)print "<script>window.addEventListener(\"load\",function(){var arr=document.querySelectorAll(\"input[type=checkbox][indeterminate]\");for(i in arr)arr[i].indeterminate=true;});</script>"}'
@olizilla
olizilla / meteor-dump.sh
Last active May 29, 2016 02:18
Dump a mongo db from a live meteor app to a local dump dir.
#!/bin/bash
# __
# _____ ____ _/ |_ ____ ____ _______
# / \ _/ __ \ \ __\_/ __ \ / _ \ \_ __ \
# | Y Y \\ ___/ | | \ ___/ ( <_> ) | | \/
# |__|_| / \___ > |__| \___ > \____/ |__|
# \/ \/ \/
#
# .___
# __| _/ __ __ _____ ______
This file has been truncated, but you can view the full file.
elementattributeTypeType is not derived from System.Attribute.Element is not a constructor, method, property, event, type or field.targetTypeValue is not a System.Int32sValue is too largeWith AllowHexSpecifier only AllowLeadingWhite and AllowTrailingWhite are permitted.Not a valid number styleValue too large or too small.Input string was not in the correct formatValue is not a System.Int64Input string was not in the correct format: s.Length==0.Input string was not in the correct format: Has Negative Sign.Input string was not in the correct format: Has Positive Sign.Input string was not in the correct format: nDigits == 0.Input string was not in the correct format: no space between number and currency symbol.Input string was not in the correct format: No room for close parens.Input string was not in the correct format: Did not parse entire string. pos = s.Length = Value is not a System.UInt32.Negative numberValue is not a System.UInt64.Value is not a System.Byte.Value too large.Value is not a System.SByte.Val
@thomasfr
thomasfr / german-porter-stemmer.js
Created March 25, 2012 21:32 — forked from marians/german-porter-stemmer.js
German Porter Stemmer in JavaScript
/* by Joder Illi, Snowball mailing list */
function stemm(word) {
/*
Put u and y between vowels into upper case
*/
word = word.replace(/([aeiouyäöü])u([aeiouyäöü])/g, '$1U$2');
word = word.replace(/([aeiouyäöü])y([aeiouyäöü])/g, '$1Y$2');
/*
and then do the following mappings,
@njbotkin
njbotkin / README.md
Last active December 19, 2019 13:25
Trigger SPA reloads without server polling with Cloudflare Workers

How it works:

  1. On app deploy, autoincrement Cloudflare KV value
  2. Cloudflare Worker adds a "version" cookie to every Response with the content from the KV
  3. Client checks cookies periodically to see if the "version" cookie has changed. If so, reload page
@nathansmith
nathansmith / screwed.js
Last active June 10, 2020 17:01
Force yourself to learn JavaScript.
// If you're a glutton for punishment, and/or claim
// that JavaScript libraries have too much "bloat",
// use this to force yourself to write JS longhand.
(function(window) {
function screwed() {
window._ = null;
window.$ = null;
window.$A = null;
window.$F = null;