Skip to content

Instantly share code, notes, and snippets.

export default function animateCSS({ element, classes = [], callback }) {
element.classList.add(...classes)
function handleAnimationEnd() {
element.classList.remove(...classes)
element.removeEventListener('animationend', handleAnimationEnd)
if (typeof callback === 'function') callback()
}
@patriknyblad
patriknyblad / xcrun_simctl_cheatsheet.md
Last active September 17, 2024 04:09
iOS Simulator Terminal Commands `$ xcrun simctl`

Managing iOS Simulators

List all simulators created

$ xcrun simctl list --json

Delete old and unavailable simulators

$ xcrun simctl delete unavailable
@jimothyGator
jimothyGator / README.md
Last active August 25, 2024 17:37
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@vikks
vikks / .rspec
Created December 6, 2012 11:38 — forked from tenderlove/.rspec
Active Record Spec Helper - Loading just active record
--colour
-I app
@ryanb
ryanb / issues_with_modules.md
Created November 29, 2012 22:38
Points on how modules can make code difficult to read.

My issues with Modules

In researching topics for RailsCasts I often read code in Rails and other gems. This is a great exercise to do. Not only will you pick up some coding tips, but it can help you better understand what makes code readable.

A common practice to organize code in gems is to divide it into modules. When this is done extensively I find it becomes very difficult to read. Before I explain further, a quick detour on instance_eval.

You can find instance_eval used in many DSLs: from routes to state machines. Here's an example from Thinking Sphinx.

class Article < ActiveRecord::Base
@hmcfletch
hmcfletch / application.rb
Created December 29, 2011 08:41
Rails project wide and personal configuration files
require File.expand_path('../boot', __FILE__)
require 'rails/all'
module MyApp
class Application < Rails::Application
# you app configuration code
end
end
@hardbap
hardbap / TechDecisions.md
Created November 27, 2011 14:37
Choices to make in a new Rails project

Team Support

Source Code Control

git (private server)
Alternative: github

Time Tracking

Cashboard