Skip to content

Instantly share code, notes, and snippets.

View ivanvolti's full-sized avatar

Ivan Volti ivanvolti

View GitHub Profile
@samselikoff
samselikoff / future-proof.md
Last active August 2, 2025 18:41
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@daneden
daneden / Readme.md
Last active May 23, 2019 08:08
SASS Importing

Importing differentiation

You might be wondering why the Sass file here is using import directives with underscores, as opposed to the normal un-suffixed and un-prefixed importing (@import "base/all";, for example.)

Well, I’ve always had "_all.scss" as an importer for directories, but today I created a component SCSS file that appeared before "_all.scss" in the file browser.

To counter this, and make sure that the importer is always the first file I see in a directory of Sass files, I renamed the importers to "__all.scss". This has the added benefit of being extremely explicit in what exactly the imported file does—it’s in charge of pulling its siblings along with it.

@zabirauf
zabirauf / ROP.ex
Created March 26, 2015 07:48
Railway Oriented Programming macros in Elixir
defmodule ROP do
defmacro try_catch(args, func) do
quote do
(fn ->
try do
unquote(args) |> unquote(func)
rescue
e -> {:error, e}
end
@daneden
daneden / Readme.md
Last active April 12, 2016 04:09
Aspirational Dropbox SCSS Guidelines (Draft)
#!/usr/bin/env bash
# Run this command to execute the script:
# curl https://gist.githubusercontent.com/daneden/c6b5cfbcff4d3cc3ca46/raw/smaller-sketch-svgs.sh | bash
# Tell Sketch to export compact SVGs
defaults write com.bohemiancoding.sketch3 svgExportCompact -bool yes
defaults write ~/Library/Preferences/com.bohemiancoding.sketch3.plist svgExportCompact -bool yes
# Tell Sketch to omit layer names as IDs for SVGs
defaults write com.bohemiancoding.sketch3 svgExportSkipAssignIdToLayerName -bool yes
@josevalim
josevalim / watcher.sh
Last active May 22, 2024 10:06
A 1LOC bash script for re-running tests whenever a lib/ or test/ file changes keeping the same VM instance
# You will need fswatch installed (available in homebrew and friends)
# The command below will run tests and wait until fswatch writes something.
# The --stale flag will only run stale entries, it requires Elixir v1.3.
fswatch lib/ test/ | mix test --stale --listen-on-stdin
@nolanlawson
nolanlawson / parens-and-perf-counterpost.md
Last active August 14, 2023 20:08
"Parens and Performance" – counterpost

"Parens and Performance" – counterpost

Kyle Simpson (@getify) wrote a very thoughtful post decrying optimize-js, which is a tool I wrote that exploits known optimizations in JavaScript engines to make JS bundles parse faster (especially minified bundles, due to what could be reasonably described as a bug in Uglify).

Kyle lays out a good case, but I tend to disagree with nearly all his points. So here's my rebuttal.