Skip to content

Instantly share code, notes, and snippets.

@chenglou
chenglou / gist:40b75d820123a9ed53d8
Last active March 13, 2024 12:14
Thoughts on Animation

Interesting part (unmounting & API) is at the end if you're not interested in the rest =).

Stress Tests

This animation proposal is just an attempt. In case it doesn't work out, I've gathered a few examples that can test the power of a future animation system.

  1. Parent is an infinitely spinning ball, and has a child ball that is also spinning. Clicking on the parent causes child to reverse spinning direction. This tests the ability of the animation system to compose animation, not in the sense of applying multiple interpolations to one or more variables passed onto the child (this should be trivial), but in the sense that the parent's constantly updating at the same time as the child, and has to ensure that it passes the animation commands correctly to it. This also tests that we can still intercept these animations (the clicking) and immediately change their configuration instead of queueing them.

  2. Typing letters and let them fly in concurrently. This tests concurrency, coordination of an array of ch

@lukelex
lukelex / edit_profile.coffee
Last active August 29, 2015 13:58
StikJS refactoring example
$("#user_picture").change ->
userPictureFileName = $(this).val().split('\\').pop();
$("#user_picture_text").html(userPictureFileName)
files = this.files
reader = new FileReader()
reader.readAsDataURL(files[0])
reader.onloadend = ->
$("#profile_pic").css("background-image", "url(" + this.result + ")")
$("#user_cover_photo").change ->
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@booleanbetrayal
booleanbetrayal / Gruntfile.js
Last active November 23, 2024 05:09
Example GruntJS configuration for a replacement to the Sprockets Rails asset pipeline
'use strict';
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var paths = {
@igorlima
igorlima / Pasta.js
Last active December 29, 2015 09:19
Introdução de como executar testes unitários em diferentes tipos de navegadores
function Pasta() {
// recipes for good pasta sauces
this.sauces = {
'bolognese': ["tomatoes", "garlic", "olive", "herbs", "meat"]
};
this.sauceIngredients = [];
}
Pasta.prototype.add = function (ingredient) {
this.sauceIngredients.push(ingredient);
@erkobridee
erkobridee / hands-on_js_angularjs.md
Last active December 25, 2015 21:09
Referências do hands-on sobre JavaScript e Angular.js
Javascript

	Como é o funcionamento de escopo 
		[window | var,function | this | 'use strict';]

	Como controlar o código 
		[closures | classe(privado, constante, publico) | singleton]
		
 closures >> IIFE - Immediately Invoked Function Expressions
@erikhenrique
erikhenrique / bin-cc.md
Last active June 30, 2024 22:14
Bin de cartões de crédito para validação

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc
Visa 4 13,16 3
Mastercard 5 16 3
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 5, 2025 13:05
A badass list of frontend development resources I collected over time.
@alex-zige
alex-zige / gist:5795358
Last active June 8, 2023 07:49
Rails Rspec API Testing Notes

Rails Rspec APIs Testing Notes

Folders Structure

  spec
  |--- apis #do not put into controllers folder. 
        |--- your_api_test_spec.rb  
  |--- controllers
  |--- models
  |--- factories
 |--- views

SMACSS + Sass + BEM

SMACSS

Scalable and
Modular
Architecture for
C
S
S