Skip to content

Instantly share code, notes, and snippets.

View anthonyec's full-sized avatar
🐢
eat the food and live

Anthony Cossins anthonyec

🐢
eat the food and live
View GitHub Profile
@140bytes
140bytes / LICENSE.txt
Created May 9, 2011 16:13
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@mager
mager / spotify-apps-sandbox-current_track.js
Created February 10, 2012 18:22
Spotify Apps API - Get the currently playing track (JS)
/* Instantiate the global sp object; include models & views */
var sp = getSpotifyApi(1);
var models = sp.require("sp://import/scripts/api/models");
// Get the track that is currently playing
var currentTrack = models.player.track;
// If nothing currently playing
if (currentTrack == null) {
$('#now-playing').append('No track currently playing');
@dabrahams
dabrahams / launchd.org
Last active July 7, 2024 12:10
Notes on Apple's under-documented launchd

Notes on Apple’s Under-Documented LaunchD

Start triggers fire regardless of other conditions

For example, StartOnMount=true will cause the job to start when anything is mounted even if other conditions, e.g. QueueDirectories, say the job should not run

Rhythm of repeating jobs

The StartInterval timer begins ticking at the moment the plist is loaded. If something like QueueDirectories is preventing the job from

@aemkei
aemkei / berlinjs.md
Last active December 15, 2015 06:19
Links from my presentation at Berlin.js
@willurd
willurd / web-servers.md
Last active July 23, 2024 17:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@andreasnymark
andreasnymark / Kirby CMS blog; get all posts
Created June 12, 2013 19:45
Blog roll. Show all post by default, to filter by tag and show archive per year. The blog is structured “…/blog/year/post”; hence the […]->children()->children()
<?php
if(param('tag')) {
// all tags are linked “…/weblog/tag:example”
$posts = $page
->children()
->children()
->visible()
->filterBy('tags', urldecode(param('tag')), ',')
->flip();
@daneden
daneden / .htaccess
Created October 17, 2013 15:43
I whipped up a cache-buster for Jekyll, similar to the jekyll-assets method. Basically, when you run `jekyll build`, cachebuster.rb generates a hash based on the current time, and shoves it into the default.html template. Requests for style-{hash}.css are redirected to style.css by .htaccess
RewriteRule (.+)-[a-zA-Z0-9]+(\.(js|css))$ $1$2 [L]
/**
* Format a date like YYYY-MM-DD.
*
* @param {string} template
* @param {Date=} [date]
* @return {string}
* @license MIT
*/
function formatDate(template, date) {
var specs = 'YYYY:MM:DD:HH:mm:ss'.split(':');
@brandonkelly
brandonkelly / templating.md
Last active February 7, 2024 15:20
Templating in EE vs. Craft