This is now an actual repo:
| /* | |
| * This work is free. You can redistribute it and/or modify it under the | |
| * terms of the Do What The Fuck You Want To Public License, Version 2, | |
| * as published by Sam Hocevar. See the COPYING file for more details. | |
| */ | |
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { |
| # From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html | |
| git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" |
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
| /* | |
| See http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| and http://blog.joelambert.co.uk/2011/06/01/a-better-settimeoutsetinterval/ | |
| */ | |
| define([ | |
| ], | |
| function () { | |
| 'use strict'; |
A primeira coisa a saber sobre a tipagem do PHP é que ela não é parecida com Java, JavaScript, Python, Ruby, C, C++, C# ou qualquer linguagem que tenha uma tipagem baseada em alguma dessas citadas. A tipagem do PHP é incomparável, e assim como tudo que não pode ser comparado é difícil de ser explicada.
De qualquer forma, a tipagem do PHP é extremamente simples se você apenas confiar na sua intuição. A primeira coisa que você tem que saber sobre a tipagem do PHP é que ela faz malabarismos. É exatamente essa a palavra: malabarismo. E o PHP é um ótimo malabarista, exceto por alguns poucos deslizes fáceis de decorar. O type juggling, traduzido para "malabarismo com tipos" é a habilidade que o PHP tem de tomar decisões intuitivas sobre conversões de tipos. Em termos grosseiros, o PHP decide toda e qualquer tipagem de variáveis em tempo de execução, não compilação (pros pedante aí que tão lendo).
Note bem: tipagem de variáveis. O PHP é multi-paradigma e, ao m
| /** | |
| * This is an example of how to make a class that fires off events to the BPM of a song. | |
| * I haven't tested it and it may require work to compile, this is based off a much more complex | |
| * manager from another project. | |
| * | |
| * Copyright (c) 2015 Eliot Lash | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights |
| package ; | |
| //Adapted from code by Grant Skinner, see bottom of file. | |
| //This is cut from https://github.com/underscorediscovery/luxe under MIT license | |
| /** | |
| Given an `initial` value for the seed, subsequent generated numbers will be predictable, | |
| and the `seed` value updated to reflect the current seed which can be used to resume predictability | |
| from an ongoing set. Uses a Park–Miller pseudo random number generator. |
| // Haxe implementation ported from https://gist.github.com/Flafla2/f0260a861be0ebdeef76 | |
| // Related article: http://flafla2.github.io/2014/08/09/perlinnoise.html | |
| class Perlin { | |
| public var repeat :Int; | |
| public function new(repeat :Int = -1) { | |
| this.repeat = repeat; | |
| } |
| class Perlin { | |
| public var repeat :Int; | |
| public function new(repeat :Int = -1) { | |
| this.repeat = repeat; | |
| } | |
| public function OctavePerlin(x :Float, y :Float, z :Float, octaves :Int, persistence :Float) { | |
| var total :Float = 0; | |
| var frequency :Float = 1; |