Skip to content

Instantly share code, notes, and snippets.

View datagutt's full-sized avatar
🐱

Thomas Lekanger datagutt

🐱
View GitHub Profile
@Tronix117
Tronix117 / I18n.coffee
Created November 19, 2012 02:11
I18n - JavaScript and CoffeeScript
###
# I18n class
# Allow you to add Internationalization to your CoffeeScript application
#
# Just call it with a `require 'util/I18n'` or `new I18n` if you don't have a `require` system
# More informations here: https://github.com/Tronix117/tradify
# Translation files should be saved in `locales/{langage code}.coffee`
#
# Then you can translate everything with `tr('{0} day', numberOfDay)`
#
@neilj
neilj / window-controller.js
Last active April 13, 2025 11:09
Cross-tab window controller
function WindowController () {
this.id = Math.random();
this.isMaster = false;
this.others = {};
window.addEventListener( 'storage', this, false );
window.addEventListener( 'unload', this, false );
this.broadcast( 'hello' );
@buhman
buhman / uefisetup.sh
Last active October 13, 2015 08:07 — forked from Apsu/uefisetup.sh
Arch Linux UEFI Setup
# Gist is stupid and doesn't seem to allow manual selection of syntax highlighting; .sh extension is used for increased readability.
# This is only a guide to show the required steps for successful UEFI + GRUB2 installation
# Many of the choices are examples or assumptions; don't blindly type shit into your machine
# until/unless you at least read the comments around each command
#
# These steps assume you've booted in UEFI mode by preparing your USB stick per these instructions:
# https://wiki.archlinux.org/index.php/UEFI#Archiso
#
# If you're using an actual CD burned from the official Arch ISO, just make sure you've booted it in UEFI mode
@david-mark
david-mark / gist:4312841
Created December 16, 2012 20:54
Unobtrusive JS === Unrealistic JS

Unobtrusive JS === Unrealistic JS

In general, Web developers want to be seen using the very latest and "greatest" Web technologies. We want to add buzzwords to our CV's as soon as they are coined and want to be considered "cutting edge" developers who are "moving the Web forward". Unfortunately, history takes a dim view of our exuberance and science ignores it completely.

Best to start at the beginning with DOM0, which came out in the 90's. Here we have a button that alerts when clicked:

<button type="button" onclick="window.alert('Hello world!')">Click me!</button>
@david-mark
david-mark / gist:4349216
Last active January 10, 2017 05:14
Progressive Destruction

Progressive Destruction

Last time we looked at the decade-long (and failed) effort to reinvent event listener attachment. We saw that the inherent graceful degradation of HTML still beats the equivalent "unobtrusive" patterns and is certainly a better bet for prototyping an application than the usual suspect DOM libraries.

There's a myth that progressive enhancement is somehow a "better" technique for browser scripting, but the fact is that they are not mutually exclusive and each has its place. This may remind you of a similar argument regarding feature detection vs. browser sniffing, but it certainly doesn't apply in that context.

We left off with the start of a draggable toolbar that works with any manner or combination of pointing devices (including your fingers).

@WebReflection
WebReflection / writeInGithub.js
Last active January 13, 2021 04:33
a silly script to write in your github timeline
/**
* so here the thing ... you go in your github page
* as example I go here: https://github.com/WebReflection
* you open your console
* you copy and paste this shit
* then you write and execute in the console
* write("Hi There!");
* NOTE: Pixel Font from a 2006 project of mine :-) http://devpro.it/pixelfont/
*/
function write(text, color, start) {
var bookBlob = new Blob([blob], {
type: "application/zip"
});
// blob contains the zip file as a Blob object
var fileReader = new FileReader();
fileReader.onload = function (evt) {
// Read out file contents as a Data URL
var result = evt.target.result;
try {
localStorage.setItem("file", result);

In case you don't know me already, I'm Jarrod Nettles, a Senior Developer at Apple Inc. I also go by the Twitter handle @hayvok, and blackshawk on Github (don't ask me why they're different). I have no real, formal blog since, well, I work at Apple. I'm posting this because I confused a good many people and I feel honor-bound to explain.

On April 1st Hacker News had their "Who's Hiring" thread. Since I'm currently looking for a developer, I decided to go ahead and post. Here's the content of that post, along with a link to the original.

https://news.ycombinator.com/item?id=5475813 - Original HN Post

Apple Inc: Cupertino, CA - Web Developer (PHP, Node.js, Ember.js) - Sorry, no remote!! Relocation offered. (I know, I know...) We're rebuilding an internal app from scratch and it needs to be blazing fast and real-time.
Here's our tech stack (right now).
@nettles-jarrod
nettles-jarrod / blog - Explaining My Choices Further.md
Last active April 25, 2023 19:31
In which I do a little digging about the choices I've made with PHP. This is a long read, but it isn't something that can be explained in one or two paragraphs.

In the comments from my last post and on Twitter I noticed a lot of people who had something to say about PHP. The comments were varied but they usally sounded something like this (sorry @ipetepete, I picked yours because it was the shortest).

...the little bits of soul from all of us who've had to work on, and or maintain large PHP applications. – ipetepete

In Pete's defense, he did go on to say that rest of the stack I was using was a "smorgasbord of awesome". Thanks, Pete. I agree!

I would, however, like to take a little time to correct a misperception in the developer community about PHP. I recently got into this same... discussion... with Jeff Atwood, and I seem to be running into it more and more. So here goes. Please bear with me as I cover a little history further on.

Pete, and everybody else, _you're exactly rig

@zhuowei
zhuowei / glasslabs.md
Last active December 17, 2015 14:29
Glass Labs experiments: what they do

Glass Lab Experiments

Updated: July 2nd (XE7)

Ron Amadeo of Android Police did a review of these experiments: http://www.androidpolice.com/2013/05/24/google-glasss-hidden-labs-features-ok-glass-everywhere-web-browsing-video-stabilization-and-more-video/

Google Glass has a series of Labs experiments that can be enabled on engineering or userdebug builds. Using APKTool, I've removed that restriction and now they can be enabled with root access.

To start, for example, the SOUND_SEARCH lab, type in a root shell