Skip to content

Instantly share code, notes, and snippets.

View cheeaun's full-sized avatar
🐘
Follow me on https://mastodon.social/@cheeaun

Chee Aun cheeaun

🐘
Follow me on https://mastodon.social/@cheeaun
View GitHub Profile
@bendyorke
bendyorke / setup.md
Last active March 12, 2021 14:25
Setting up a new mac
@machty
machty / document-title-router.js
Created January 14, 2014 05:12
document.title integration in ember
// Extend Ember.Route to add support for sensible
// document.title integration.
Ember.Route.reopen({
// `titleToken` can either be a static string or a function
// that accepts a model object and returns a string (or array
// of strings if there are multiple tokens).
titleToken: null,
@cheeaun
cheeaun / rdrc2013.md
Last active December 18, 2015 04:59
RedDotRubyConf 2013 links & resources
var fs = require( "fs" ),
request = require( "request" ),
xml2js = require( "xml2js").parseString,
exec = require( "child_process" ).exec,
pages = [1, 2, 3, 4, 5, 6, 7],
team = "core";
pages.forEach(function(page) {
request.get("http://jquery.org/updates/category/" + team + "/feed/atom/?paged=" + page, function(request, response, body) {
xml2js(body, {explicitArray: false}, function( err, result ) {
@impressiver
impressiver / raven-config.html
Last active October 26, 2024 15:03
Raven.js configuration for logging JavaScript exceptions to Sentry (https://getsentry.com/). Without the added ignore options, you'll quickly find yourself swamped with unactionable exceptions due to shoddy browser plugins and 3rd party script errors.
<!-- Raven.js Config -->
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script>
<script type="text/javascript">
// Ignore list based off: https://gist.github.com/1878283
var ravenOptions = {
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion.
// See: https://github.com/getsentry/raven-js/issues/73
ignoreErrors: [
// Random plugins/extensions
'top.GLOBALS',

Bookmarklet to switch between HackerNews and HackerWeb

This bookmarklet toggles between HackerNews pages and Cheeuan's HackerWeb interface. If you're not on either then it acts a a bookmark to HackerWeb.

The code

If you edit this, use something like bookmarkleter to convert it into a bookmarklet.

if ( /https?:\/\/news\.ycombinator\.com\/item\?id=(\d+)/.test(location) ) {

location = 'http://cheeaun.github.io/hackerweb/#/item/' + RegExp.$1;

@murtaugh
murtaugh / 1. single-line.html
Last active April 21, 2021 16:23
Blockquote patterns for ALA
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
</figure>
@remy
remy / dateutil.js
Created September 2, 2012 23:10
Super simple library for date time formatting.
var dateUtil = function () {
var monthDict = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
return {
time: function (date) {
var hour = date.getHours(),
min = date.getMinutes() + "",
ampm = 'AM';
if (hour == 0) {
hour = 12;
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: