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
<script type="text/javascript" charset="utf-8"> | |
window.setTimeout(function() { | |
var script = document.createElement("script"); | |
script.src = "http://www.observerapp.com/record.js"; | |
script.type = "text/javascript"; | |
script.onload = function() { | |
Observerapp.record("agtvYnNlcnZlcmFwcHINCxIEU2l0ZRj4mJ8BDA"); | |
} | |
document.getElementsByTagName("head")[0].appendChild(script); | |
}, 10000); |
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
➜ video_app git:(master) ✗ bundle exec rake -T | |
rake about # List versions of all Rails frameworks and the environment | |
rake bourbon:install[sass_path] # Move files to the Rails assets directory. | |
rake db:create # Create the database from config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config) | |
rake db:drop # Drops the database for the current Rails.env (use db:drop:all to drop all databases) | |
rake db:fixtures:load # Load fixtures into the current environment's database. | |
rake db:migrate # Migrate the database (options: VERSION=x, VERBOSE=false). | |
rake db:migrate:status # Display status of migrations | |
rake db:rollback # Rolls the schema back to the previous version (specify steps w/ STEP=n). |
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 data ="testing or not to testing?"; | |
function test(data) { console.log(data);} | |
var is_a_tune=self.setInterval("test(data)",1000); | |
// Stop | |
is_a_tune=window.clearInterval(is_a_tune) | |
var is_a_tune=self.setTimeout("test(data)",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
$(document).ready(function() { | |
$(".box").draggable({ | |
revert: true | |
}); | |
$(".box").droppable({ | |
activeClass: "drop-active", |
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
➜ Development cd JavaScripts | |
➜ JavaScripts curl install.meteor.com | sh | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 5238 0 5238 0 0 4497 0 --:--:-- 0:00:01 --:--:-- 7580 | |
Installing Meteor to /usr/local/meteor | |
... downloading | |
######################################################################## 100.0% | |
Meteor installed! To get started fast: |
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> | |
<head> | |
<title>UJS Example</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(function() { | |
$("#alert").click(function() { | |
alert(this.getAttribute("data-message")); | |
return 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
javascript: var s; | |
/*Figure out the selected text*/ | |
if ( window.getSelection ) { | |
s = window.getSelection(); | |
} else if ( document.getSelection ) { | |
s = document.getSelection(); | |
} else { | |
s = document.selection.createRange().text; | |
} | |
/*If there isn't any text selected, get user input*/ |
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
// node: | |
var moment = require('moment'); | |
moment().add('days', 2).fromNow(); | |
// 'in 2 days' | |
moment().subtract('days', 2).fromNow(); | |
// '2 days ago' | |
moment('November 1977').fromNow() |
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
<head> | |
</head> | |
<body> | |
<time class="time_ago" data-date="1342319482"></time> | |
<time class="time_ago" data-date="1334381474"></time> | |
<script src="http://localhost:3030/javascripts/jquery.js?1333364529"></script> |
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
module YoutubeID | |
FORMATS = [ | |
%r(https?://youtu\.be/(.+)), | |
%r(https?://www\.youtube\.com/watch\?v=(.*?)(&|#|$)), | |
%r(https?://www\.youtube\.com/embed/(.*?)(\?|$)), | |
%r(https?://www\.youtube\.com/v/(.*?)(#|\?|$)), | |
%r(https?://www\.youtube\.com/user/.*?#\w/\w/\w/\w/(.+)\b) | |
] |