Skip to content

Instantly share code, notes, and snippets.

View topherPedersen's full-sized avatar
💭
Rolling my katamari ball

Christopher Pedersen topherPedersen

💭
Rolling my katamari ball
View GitHub Profile
@topherPedersen
topherPedersen / randomWord.js
Created October 2, 2019 00:08 — forked from jaxatax/randomWord.js
Random word generation in JS.
Array.prototype.randomElement = function () {
return this[Math.floor(Math.random() * this.length)];
}
var consonant = [
"th",
"th",
"n",
"mb",
"r",
@topherPedersen
topherPedersen / randomWord.js
Created October 2, 2019 00:08 — forked from jaxatax/randomWord.js
Random word generation in JS.
Array.prototype.randomElement = function () {
return this[Math.floor(Math.random() * this.length)];
}
var consonant = [
"th",
"th",
"n",
"mb",
"r",
@topherPedersen
topherPedersen / game.py
Created August 24, 2019 14:09 — forked from PlainSight/game.py
Simple Multiplayer Python Game and Server
import pygame, sys
from pygame.locals import *
import pickle
import select
import socket
WIDTH = 400
HEIGHT = 400
BUFFERSIZE = 2048
@topherPedersen
topherPedersen / AppDelegate.swift
Created December 5, 2018 07:59 — forked from phatblat/AppDelegate.swift
Example of creating HKObserverQuery and enabling background delivery for multiple HKObjectType
@UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate {
let healthKitManager = HealthKitManager()
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
if onboardingComplete {
healthKitManager.requestAccessWithCompletion() { success, error in
if success { print("HealthKit access granted") }
else { print("Error requesting access to HealthKit: \(error)") }
}
@topherPedersen
topherPedersen / get.js
Created December 26, 2017 22:34 — forked from rafaelstz/get.js
AJAX GET and POST with pure Javascript
// Exemplo de requisição GET
var ajax = new XMLHttpRequest();
// Seta tipo de requisição e URL com os parâmetros
ajax.open("GET", "minha-url-api.com/?name=Henry&lastname=Ford", true);
// Envia a requisição
ajax.send();
// Cria um evento para receber o retorno.