Skip to content

Instantly share code, notes, and snippets.

View shinypb's full-sized avatar
☀️
I'm just happy to be here.

Mark Christian shinypb

☀️
I'm just happy to be here.
View GitHub Profile
@shinypb
shinypb / gist:1424674
Created December 2, 2011 20:13
Nyancat in your Terminal
curl http://markchristian.org/projects/nyancat/nyancat.sh -o ~/bin/nyancat; chmod +x ~/bin/nyancat; ~/bin/nyancat
<!DOCTYPE html>
<html>
<body>
<div id="templates" style="display:none;">
<div id="header" class="template"><!--
<i>{{awesomeGuy}} is awesome</i>
--></div>
<div id="body" class="template"><!--
<i>Hello, {{name}}!</i>
--></div>
cerebus:~ shinyplasticbag$ cat /home/shinyplasticbag/domains/markchristian.org/projects/ideafactory/ideas.txt
Mark at 2007-11-21@14:00:
I like things.
Seanstoppable at 2007-11-21@14:07:
What I Like
A site where you can make a list of things you have owned/rented/tried and, based on the rating you provide, gives you suggestions of other things you like.
Kinda like Amazon reccomendations, except easier to add things you already have.
Caused by this code:
NSImage *translucentImage = [[NSImage alloc] initWithSize:[imageRep size]];
NSRect rect = NSMakeRect(0, 0, [image size].width, [image size].height);
[translucentImage lockFocus];
Running on the main thread. WTF.
#0 0x00007fff910a2a4f in CGSFillDRAM8by1 ()
#1 0x00007fff91105fb6 in argb32_mark_constshape ()
#2 0x00007fff911059c3 in argb32_mark ()
@shinypb
shinypb / gist:2855218
Created June 1, 2012 21:24
Async Deck loading code
<div id="SidebarTheDeck">
<script type="text/javascript">
(function(id) {
var theDeck = document.createElement('script'); theDeck.type = 'text/javascript'; theDeck.async = true;
theDeck.src = 'http://connect.decknetwork.net/deck' + id + '_js.php?' + (new Date().getTime());
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(theDeck, s);
})("DF");
</script>
</div>
{
:test_nokogiri =>
{
:text_without_entities => 1.440876,
:text_with_entities => 1.48466
},
:test_nokogiri_new =>
{
:text_without_entities => 1.42785,
:text_with_entities => 1.53331
@shinypb
shinypb / defineClass.js
Created December 9, 2012 04:21
A relatively small, pretty crappy inheritance/class thingy
// Here's the defineClass function
(function() {
function defineClass() {
var kDefineClassMagicValue = 'defineClass_do_not_call_user_provided_constructor';
var args = Array.prototype.slice.apply(arguments);
var className, superClassName, constructor, properties;
className = args.shift();
if (typeof args[0] == 'string') {
superClassName = args.shift();
@shinypb
shinypb / gist:4485878
Created January 8, 2013 17:32
Bookmarklet to reload CSS without reloading the entire page
(function(){
$('link[rel="stylesheet"]').each(function(i, elem) {
// Make an anchor tag with the stylesheet's href -- this is a weird/handy way of
// working with URLs in the browser.
var anchorTag = $('a').attr('href', elem.getAttribute('href'))[0];
// Rewrite the URL to have a cache busting parameter. This assumes
// that any query params weren't significant.
anchorTag.search = "ts=" + (+new Date);
@shinypb
shinypb / controller.js
Last active December 12, 2015 07:49 — forked from darobin/controller.js
var fallbacks = {}
, networks = {}
, cacheName = "OldSchoolAppCache"
, settings = {}
;
this.onmessage = function (e) {
var msg = e.data;
if (msg.type && msg.type === "manifest") {
var lines = msg.manifest.split(/\n+/)
2013 Canada Day
by Mark Christian and 4 collaborators
All Canadian tweeps are welcome to edit.
Add Playlist Edit Share Buy MP3s 68 songs (4:26:26)
1
4:46 CLEAN
Take Off
Doug McKenzie, Bob McKenzie - Great White North