This file contains hidden or 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 userChoice = prompt("Please choose rock, paper, or scissors"); | |
var computerChoice = Math.random(); | |
if(computerChoice >=0 && computerChoice<0.33){ | |
computerChoice = "rock"; | |
} | |
else if((computerChoice > 0.33) && (computerChoice<0.67)){ | |
computerChoice = "scissors"; | |
} | |
// never do an if/else without {}. It's a lie that it is is allowed. NO! Just don't do it! It's like cake. | |
else { |
This file contains hidden or 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
/* file: server/data.js */ | |
Meteor.publish("helptexts",function() { | |
return HelpTexts.find(); | |
}); | |
Meteor.publish("publishTest", function () { | |
return HelpTexts.find({_id: "help-demo"}); | |
}); | |
This file contains hidden or 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
#!/bin/bash | |
curl https://install.meteor.com > ./install_meteor | |
sed -i'' -e 's/PREFIX=.*/PREFIX="$HOME"/g' ./install_meteor | |
chmod u+x ./install_meteor | |
./install_meteor |
This file contains hidden or 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
Feeds = new Meteor.Collection('feeds'); | |
if (Meteor.isServer) { | |
var twitter_user_id = 0; | |
var boundCallback = Meteor.bindEnvironment(function (err, resp) { | |
var timestamp = new Date().getTime(); | |
for (var obj in resp['statuses']) { | |
twitter_user_id = resp['statuses'][obj].user.id; | |
Feeds.insert({ | |
feed: resp['statuses'][obj].text, |
This file contains hidden or 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
x = 1 | |
foo = -> | |
x = 2 | |
return | |
foo() | |
console.log x; #prints 2 |
This file contains hidden or 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 FB_activity(models.Model): | |
fbid = models.TextField() | |
activity_type = models.TextField() | |
body = models.TextField() | |
tags = ArrayField(dbtype="text", dimension=2) | |
likes = ArrayField(dbtype="text", dimension=2) | |
comments = ArrayField(dbtype="text", dimension=2) | |
raw = models.TextField() | |
objects = ExpressionManager() |
This file contains hidden or 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
Environment: | |
Request Method: GET | |
Request URL: http://localhost:8000/admin/SocialNetworkData/fb_activity/4/ | |
Django Version: 1.5 | |
Python Version: 2.7.2 | |
Installed Applications: | |
('django.contrib.auth', |
This file contains hidden or 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
//To turn on the mapping stuff uncomment lines marked //--// | |
(function($) { | |
$.widget("ui.tweeter", { | |
options: { | |
url_prefix:"/", | |
default_value: "buffalo wild wings", | |
color: "#fff", | |
width: "50%", | |
speed_up_size: 25, |
This file contains hidden or 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
<div class="yourFancyBoxClass"> | |
{% if success %} | |
<h2>It Worked!</h2> | |
{% else %} | |
<form action="{% url ajax_form %}"> | |
{% form %} | |
</form> | |
{% endif %} | |
</div> |
This file contains hidden or 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
from classes import Point, QuadTree | |
import sys | |
pt1 = Point(0,0) | |
points = [] | |
for i in range(-2,1): | |
for j in range(-2,1): | |
tmp = Point(i,j) | |
points.append(tmp) |
NewerOlder