I hereby claim:
- I am alanhogan on github.
- I am alanhogan (https://keybase.io/alanhogan) on keybase.
- I have a public key ASBsuC4ft6MgMV-UB77lHthuXxHIhQhvcYqMt_RY1Sl70go
To claim this, I am signing this object:
# Allow failing on regex pattern match | |
# See https://superuser.com/a/1717757/60337 | |
failon() ( | |
pattern="$1" | |
shift | |
[ "$#" -eq 0 ] && set cat | |
FAILON_STATUS="${FAILON_STATUS:-125}" | |
set -o pipefail | |
{ "$@" \ | |
| "$@" >&3 \ |
#!/usr/bin/env ruby | |
require 'find' | |
puts "Deleting all .scss files !!!! !!11" | |
deleted = 0 | |
Find.find('.') do |path| | |
if FileTest.directory?(path) |
#!/usr/bin/env ruby | |
require 'find' | |
puts "Yo dawg, i only work on .scss files, not .sass. just a warning." | |
nonMatchingFiles = 0 | |
def fileContents(filename) | |
data = '' |
<!-- LOCALIZERS: Each localizable piece of the page is marked with a comment --> | |
<html> | |
<head> | |
<link rel=stylesheet type="text/css" href="page-load-errors.css"> | |
<!-- LOCALIZERS: You might want to change the font family. You can also add styles to override sizes, etc. --> | |
<style> | |
body {font-family:'-apple-system-font';} | |
</style> | |
<!-- LOCALIZERS: The next line contains the page title that appears in the window's title bar --> | |
<title>Failed to open page</title> |
I hereby claim:
To claim this, I am signing this object:
payWithTweet
is a jQuery plugin that makes you go tweet something to unlock an action on the page. You can bypass it by running:
function createCookie(name,value,days){var expires;if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+ date.toGMTString();}else{expires="";}
document.cookie=encodeURIComponent(name)+"="+ encodeURIComponent(value)+ expires+"; path=/";}
createCookie("tweetToDownload",true,30);
npm shrinkwrap
is useful, but maddening (once it's in place and you want to update a package).
Say you've got a package.json
with module ember-cli
as a devDependency
currently at version 1.13.1
. And you have an npm-shrinkwrap.json
file too, generated with the --dev
flag.
If you change the version of ember-cli
to, say, 1.13.8
in package.json
and run npm install
, nothing will happen.
If you do that and manually change references in the shrinkwrap file, you will still have trouble (as nested dependencies may now be incorrect).
$four: "4"; | |
$seven: "7"; | |
$pi: 3.14159; | |
$phi: 1.618; | |
$null: null; | |
@if $seven > $four { // may only compare numbers on line 2 at column 9 | |
.fourIsBiggerThanSeven { | |
color: green; | |
} |
$ = require 'jquery' | |
module.exports = do -> | |
init = -> | |
$(document).on 'click', '.js-autoselect', (e) -> | |
range = document.createRange() | |
selection = window.getSelection() | |
range.selectNodeContents this |
Here are some of the "gotchas" I've encountered when I converted all the javascript code into coffeescript. (BTW, this is gathered while coding for YourMechanic.com, a very cool mobile auto repair service.)
Disclaimer: Coffeescript is a great productivity booster for me personally. Even with all the things outlined below, it is still way better than javascript. None of these should discourage you from jumping into it right away.
(Things that generate wrong code silently)