I hereby claim:
- I am loginx on github.
- I am xspriet (https://keybase.io/xspriet) on keybase.
- I have a public key ASDZRegHtifsrXrSz1bTuPvi16EhCVA759klbbbAGb08lAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Insert this in ~/.bashrc or ~/.bash_login | |
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo " ("${ref#refs/heads/}")" | |
} | |
export PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\$(parse_git_branch) \$\[\033[00m\] " |
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo " ("${ref#refs/heads/}")" | |
} | |
export PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\$(parse_git_branch) \$\[\033[00m\] " |
$.fn.overlaps = (el) -> | |
el = $(el) | |
o = | |
el1: @offset() | |
el2: el.offset() | |
el1 = | |
x1: o.el1.left | |
x2: o.el1.left + @width() |
# jQuery method to detect whether or not a point (x,y) is within the bounds of a jQuery element. | |
# Example usage: $("#container").containsPoint 100, 100 | |
$.fn.containsPoint = (x, y) -> | |
(@offset.left < x < @offset.left + @width()) and | |
(@offset.top < y < @offset.top + @height()) |
<html> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=8" /> | |
<title>Batman Profiler</title> | |
<script type="text/javascript" src="https://raw.github.com/Shopify/batman/master/lib/es5-shim.js"></script> | |
<script type="text/javascript" src="https://raw.github.com/Shopify/batman/v0.9.0/lib/batman.js"></script> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script> | |
<script type="text/javascript" src="http://coffeescript.org/extras/coffee-script.js"></script> | |
<script src="http://code.highcharts.com/highcharts.js"></script> |
User.find(1).flag Tablet.find(1) | |
# => #<MakeFlaggable::Flagging id: 1, flaggable_type: "Device", flaggable_id: 1, flagger_type: "User", flagger_id: 1, reason: nil, created_at: "2012-05-30 16:16:23", updated_at: "2012-05-30 16:16:23"> | |
User.find(1).flagged? Tablet.find(1) | |
# MakeFlaggable::Flagging Load (0.4ms) SELECT "flaggings".* FROM "flaggings" WHERE "flaggings"."flagger_id" = 1 AND "flaggings"."flagger_type" = 'User' AND "flaggings"."flaggable_type" = 'Tablet' AND "flaggings"."flaggable_id" = 1 LIMIT 1 | |
# => false | |
# :rage: | |
######### | |
# If you look at the query, it inserted the `flaggable_type` as 'Device', but is searching for 'Tablet' |
<div data-replace="item"> | |
PARTIAL 1: <span data-bind="item.name"></span> | |
</div> |