Skip to content

Instantly share code, notes, and snippets.

for (i = 0; i < 1001; i++) {
(function(i){
setTimeout(function(){
var star = stars.create(Math.floor(Math.random() * 20 + 1 + currentX ),
Math.floor(Math.random() * 120 + 100 ), 'star');
// Create Starts That Rain Above Player With A Bit Of 'Noise' (x, y, type)
star.body.gravity.y = 300;
const Twit = require('twit');
const config = require('./config');
const T = new Twit(config);
const badThingsToSay = [
'What font do you use?',
'Hello, whats the name of the font you use font?',
'Hey Wes, what\'s the name of that weird font you use?',
'Weird font that you use. Mind telling me what it\'s called?',
'What is the name of the font you use................ I\'ve never seen it before...',
@ollybritton
ollybritton / newton.js
Created December 23, 2016 19:48
Newtons Root Method (Not) Implemented In Js.
var derivativeOfATerm = function(arr) {
var one = arr[0];
var two = arr[1];
var derivative = [];
if(two <= 0) {
return [0,0];
} else {
derivative.push(one*two);
derivative.push(two-1);
return derivative;
import Control.Monad
import Data.List
factors num = [x | x <- [1..num], num `mod` x == 0]
primesUnder limit = [x | x <- 2:[3,5..limit], sum(factors x) == x+1]
isPrime num = if sum(factors(num)) == num+1 then True else False
allPrimes = [x | x <- 2:[3,5..], sum(factors x) == x+1]
nextPrime num = findIndex (>num) allPrimes
<!DOCTYPE html>
<html>
<head>
<title>Remember Me!</title>
<style>
body {
display: flex;
import tweepy, json, random, time, sys
from data import *
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
following_list = api.followers_ids("zaksanderson01")
class StdOutListener(tweepy.StreamListener):
// jshint esversion: 6
const Discord = require("discord.js");
const mark = require("./mark");
const client = new Discord.Client();
let chattiness = 0.5;
// Initialise a chattiness, which is a measure of how often it speaks by itself.
client.on("ready", () => {
from os import *while True: system("cls") option = raw_input("What would you like to do? Type 'c' for command prompt or 'm' to run os commands in general >> ")  if option == "m":
  while True:   command = raw_input("Type 'esc' to escape at any time >> ")   if command.lower() == "esc":    break
   exec(command)
 else:  while True:   command = raw_input("Type 'esc' to escape at any time >> ")   if command.lower() == "esc":    break
   system(command)
@ollybritton
ollybritton / buzz.py
Created October 28, 2017 23:04
My god.
#coding=utf-8
import RPi.GPIO as gp
import random
from time import sleep
buzz_pin = 11
key_pin = 16
disarm_length = 6
echo "This script provides an easy way to set up a twitter bot that tells you what is currently playing on your radio station First we just need to install some stuff, so you will need to enter your password. If anything fails, please contanct Olly. Press <ENTER> to continue: "
read
sudo apt-get update
sudo apt-get install python3-pip
sudo pip install tweepy
# Use special options