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 id,max=0;var videos= _jsdata.videos; for(var i=0;i<videos.length;i++){if( parseInt(videos[i].votes,10) >max) {max= videos[i].votes; id = videos[i]; }}; console.log(id) |
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
for(var i=0;i<52;i++) {$.post('https://powerballads.ie/ajax/vote/59',function(r){console.log(r)})} |
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
(def comment-data [{:author "Pete Hunt" :text "This ia comment."} | |
{:author "Jordan Walke" :text "This is *another* coment"}]) | |
(into-array | |
(map #(om/build comment (comment-data %)) | |
(range (count comment-data)) | |
) | |
) |
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
org.gradle.daemon=true |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
require 'RMagick' | |
include Magick | |
width = 90 | |
height = 100 | |
matrix = [ | |
[0,1,0,0,0], | |
[0,1,0,0,0], | |
[0,0,1,0,0], | |
[0,1,0,0,0], | |
[0,1,0,0,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
#!/usr/bin/env ruby | |
# ______ _ _ | |
# | ___ \ (_) | | |
# | |_/ /_ __ ___ _ __ _| | ___ _ __ | |
# | ___ \ '__/ _ \| '_ \| | |/ _ \ '__| | |
# | |_/ / | | (_) | |_) | | | __/ | | |
# \____/|_| \___/| .__/|_|_|\___|_| | |
# | | | |
# |_| | |
require 'net/scp' |
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
class Employee < ActiveRecord::Base | |
has_many :timeslots | |
scope :free_time, lambda {|day| joins(:timeslots).merge(Timeslot.on(day)) } | |
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
promptList (x:[]) partial = do | |
putStrLn ("Enter value for " ++ x) | |
input<-getLine | |
(partial ++ [input]) | |
promptList (x:xs) partial = do | |
putStrLn ("Enter value for " ++ x) | |
input<-getLine | |
promptList xs (partial ++ [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
public class Message{ | |
public String recipient, sender,body; | |
public Message(String recipient, String sender,String body){ | |
this.recipient=recipient; | |
this.sender=sender; | |
this.body = body; | |
} | |
public void append(String text){ | |
this.body = this.body + text; |