Skip to content

Instantly share code, notes, and snippets.

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 {
/* file: server/data.js */
Meteor.publish("helptexts",function() {
return HelpTexts.find();
});
Meteor.publish("publishTest", function () {
return HelpTexts.find({_id: "help-demo"});
});
#!/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
@jhgaylor
jhgaylor / meteor.js
Last active January 1, 2016 02:29 — forked from ricomoss/gist:8079884
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,
x = 1
foo = ->
x = 2
return
foo()
console.log x; #prints 2
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()
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',
//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,
<div class="yourFancyBoxClass">
{% if success %}
<h2>It Worked!</h2>
{% else %}
<form action="{% url ajax_form %}">
{% form %}
</form>
{% endif %}
</div>
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)