This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert string keys to symbols for a hash | |
class Hash | |
def symbolize_keys | |
self.replace(self.inject({}) { |h,(k,v)| h[k.to_sym] = v; h }) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT='%{$fg[cyan]%}%c $(rvm_prompt_info) %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%} | |
%{$fg_bold[red]%}➜ %{$reset_color%}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>CSS 3 clock face</title> | |
<style type='text/css'> | |
* { | |
margin: 0; | |
padding: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>3D Text</title> | |
<style> | |
body { | |
background-color: #11a9e2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type=“spacer-tile”;}’ | |
> killall Dock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myCountdown = (function () { | |
var index; | |
function log() { | |
console.log(index) | |
} | |
function iterate() { | |
log(); | |
if(index>1) setTimeout(iterate, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Person = function (name) { | |
this.name = name; | |
} | |
Person.prototype.getName = function () { | |
console.log(this.name); | |
} | |
var thomas = new Person("Thomas"); | |
var amy = new Person("Amy") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Answer 1 | |
document.getElementById('the_div').addEventListener( | |
'click', function(){ log('the_div!') }, true); | |
document.getElementById('the_list').addEventListener( | |
'click', function(){ log('the_list!') }, false); | |
document.getElementById('the_item').addEventListener( | |
'click', function(){ log('the_item!') }, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This does not appear to recognize the :target => "_blank" when the page is rendered | |
simple_format(auto_link(@task.description, :html => { :target => "_blank" })) | |
# However, this works fine | |
auto_link(simple_format(@task.description), :html => { :target => "_blank" }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First Steps | |
======================================================================================== | |
# Initialize git in a project | |
git init | |
# add and commit any existing files | |
git add . | |
git commit -m "Initial commit" | |
# associate with a remote repository |
OlderNewer