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 MainController < NSWindowController | |
def awakeFromNib | |
end | |
def newWindow(sender) | |
someData = "Blob" | |
nw = MainWindowController.alloc.init |
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 'yaml' | |
# setup an object to serialize with yaml | |
class Square | |
attr_accessor :width, :height, :bonus, :me | |
def initialize width, height | |
@width = width | |
@height = height | |
@bonus = ['yo',{:msg => 'YAML 4TW', :alert => 'I am an alert'}] | |
@me = self |
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
$("#EnglishName").blur(function () { | |
$.ajax({ | |
url: "/Search/AjaxAddSearch", | |
dataType: "json", | |
data: { | |
showTitle: $("#EnglishName").val() | |
}, | |
success: function (data) { | |
$(".possibleShows").css("visibility", "visible") | |
.html("<pre>"+ data +"</pre>") |
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 GenresController < ApplicationController | |
def all | |
snippet = params[:genre] | |
@genres = Genre.where("name LIKE '%#{snippet}%'") | |
respond_to do |format| | |
format.json do | |
render :json => @genres.map(&:name) | |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
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 'sqlite3' | |
db = SQLite3::Database.new "db.sqlite3" | |
File.open('foods.csv', 'r') do |infile| | |
counter = 2 | |
while(line = infile.gets) | |
food = line.split(',')[0] | |
db.execute("insert into pantry_foodtype values (#{counter},#{counter},\"#{food}\",\"#{food}\", 5)") | |
counter += 1 |
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
#include <iostream> | |
#include <stdlib.h> | |
#include <math.h> | |
using namespace std; | |
int heapSize = 0; | |
int leftChild(int index) | |
{ |
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
#include <iostream> | |
#include <stdlib.h> | |
#include <limits.h> | |
#include <fstream> | |
#include <string> | |
#include <sstream> | |
using namespace std; | |
ofstream outfile; |
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
<body onload="onBodyLoad()"> | |
<div data-role="page" id="home"> | |
<div data-role="header"> | |
<h1>My Title</h1> | |
</div><!-- /header --> | |
<div data-role="content"> | |
<p class="sup">Hello world</p> | |
<p><a href="#contracts" data-role="button">Contracts</a></p> | |
</div><!-- /content --> |
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
<html> | |
<head> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$(".touch").click(function(){ | |
alert($(this).html()); | |
}); | |
}); | |
</script> |
OlderNewer