Skip to content

Instantly share code, notes, and snippets.

View lovethebomb's full-sized avatar
🏠
Working from home

Lucas Heymès lovethebomb

🏠
Working from home
View GitHub Profile
@lovethebomb
lovethebomb / index.html
Last active February 15, 2017 17:53
nested Array.prototype.slice vs [].slice.call vs cached prototype vs cached [].slice (http://jsbench.github.io/#70b2b0cf82209c4bbf9d342a8684e3bd) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>nested Array.prototype.slice vs [].slice.call vs cached prototype vs cached [].slice</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@bearfrieze
bearfrieze / comprehensions.md
Last active December 23, 2023 22:49
Comprehensions in Python the Jedi way

Comprehensions in Python the Jedi way

by Bjørn Friese

Beautiful is better than ugly. Explicit is better than implicit.

-- The Zen of Python

I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.

@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active April 21, 2024 23:48
An Open Letter to Developers Everywhere (About Cryptography)
@mnot
mnot / snowden-ietf93.md
Last active September 12, 2023 13:40
Transcript of Edward Snowden's comments at IETF93.
@hdragomir
hdragomir / sm-annotated.html
Last active March 5, 2024 08:57
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);

#Angular.js / Vue.js similarities & differences

##Similar stuff

  • Same transtion API (enter/leave)
  • Filters
  • Two-way data-binding
  • Nested scope inheritance
  • Modules:
(function(Backbone, _) {
var leave, leaveArgs;
_.extend(Backbone.Router.prototype, Backbone.Events, {
route : function(route, name, callback) {
if(!callback)
callback = this[name];
var before
, fn = callback