Skip to content

Instantly share code, notes, and snippets.

View msroot's full-sized avatar
:octocat:

Yannis Kolovos msroot

:octocat:
View GitHub Profile
<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);
➜ 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).
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);
$(document).ready(function() {
$(".box").draggable({
revert: true
});
$(".box").droppable({
activeClass: "drop-active",
➜ 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:
<!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;
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*/
@msroot
msroot / moment-in-node.js
Created July 14, 2012 11:39 — forked from founddrama/moment-in-node.js
Moment.js examples
// 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()
@msroot
msroot / gist:3114765
Created July 15, 2012 03:24
time ago with now.js
<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>
@msroot
msroot / gist:3196026
Created July 29, 2012 04:19
YoutubeID
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)
]