Skip to content

Instantly share code, notes, and snippets.

View franklinjavier's full-sized avatar

Franklin Javier franklinjavier

View GitHub Profile
@netojoaobatista
netojoaobatista / ensaio-sobre-a-amnesia.md
Last active August 29, 2015 14:10
Ensaio sobre a amnésia

Ensaio sobre a amnésia

Num determinado dia de um determinado mês, um ser malévolo de outra galáxia, utilizando-se de uma arma especial, apagou a memória de todos os indivíduos do planeta Terra. Ainda, todas as pessoas tiveram suas roupas modificadas e passaram a utilizar apenas um chinelo, uma calça e uma camisa branca. Feito isso, esse ser malévolo disse a todos:

A partir de agora, ninguém sabe quem é, o que faz, nem o que tem. Ninguém é opressor ou oprimido. Ninguém é maioria ou minoria. Durante o período de um ano, todos os indivíduos do planeta precisarão definir juntos, as regras que irão reger a sociedade. Ao final desse ano, irei reverter a amnésia coletiva e todos passarão a estar sujeitos às regras que definiram.

Lembrem-se: Vocês não sabem se fazem parte da maioria ou da minoria, se são opressores ou oprimidos, se tem muito ou se não tem nada. Ao definir as regras, tomem o cuidado de ser justos, pois a injustiça poderá recair sobre você.

Sabendo que qualquer um tem exatamente a mesma proba

@amoilanen
amoilanen / promisify_require.js
Last active April 1, 2021 13:54
Enhances 'require' from RequireJS with Promises API while preserving its original semantics. Now 'require' calls can be chained.
/*
* Enhances 'require' from RequireJS with Promises API while preserving its original semantics.
*/
(function() {
if (!Promise || !require) {
return;
}
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@scottjehl
scottjehl / noncritcss.md
Last active August 12, 2023 16:57
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/


For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

@vitorbritto
vitorbritto / regex.md
Last active May 2, 2024 13:24
Regex Cheat Sheet

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping
@paulcuth
paulcuth / README.md
Last active August 13, 2017 20:25
Lua port of Slimdown.

Slimdown

This is a Lua port of of jbroadway's PHP project of the same name.

A very basic pattern-based Markdown parser. Supports the following elements (and can be extended via slimdown.addRule()):

  • Headers
  • Links
  • Bold
@jonlabelle
jonlabelle / aspdotnet-razor-syntax-reference.md
Last active November 11, 2022 15:48
ASP.NET Razor Syntax Reference

ASP.NET Razor Syntax Reference

Code Block

@{
    int x = 123;
    string y = "because.";
}

Expression (Html Encoded)

@jemsgit
jemsgit / cutmov2gif.sh
Last active August 20, 2022 22:21
cut movie and make gif
#!/bin/bash
#Start time
StTime="00:02:31"
#Length of video
LenV="00:00:05"
#Quantity images per sec
R="4"
#Width of images
WIDTH="600"
@guptag
guptag / Q.js Examples
Last active April 4, 2021 06:22
Q.js examples - Small snippets to understand various api methods in Q.js
//To run Q.js examples:
// 1. Open a new browser tab in Chrome and turn on developer toolbar (or open any http site).
// 2. Copy/Paste this gist in the console and hit enter to run the snippets.
// Based on the inspiration from samples @ https://github.com/kriskowal/q
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
@addyosmani
addyosmani / examples.md
Last active February 23, 2016 18:22
Object.observe() examples from my talk

What are we trying to observe? Raw object data.

// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
 
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];