Skip to content

Instantly share code, notes, and snippets.

View leinonen's full-sized avatar

Peter Leinonen leinonen

View GitHub Profile
const request = require('request')
const host = ''
const interval = 100
const president = 'That guy'
let voteCount = 0
let errorCount = 0
const handleResult = (err, res, body) => {
if (!err && res.statusCode === 200) {
const R = require('ramda')
const request = require('request')
const cheerio = require('cheerio')
const host = ''
const refreshInterval = 5000
const sortByScore = R.sortWith([R.descend(R.prop('score'))])
function getScores(data) {
const $ = cheerio.load(data)
let rawScores = $('#results').text().trim().split(' | ')
@leinonen
leinonen / rövarspråket.js
Last active November 26, 2018 13:00
Rövarspråket
'Jag talar Rövarspråket!'
.split('')
.reduce((a, b) => a + ('bcdfghjklmnpqrstvwxz'.split('').includes(b.toLowerCase()) ? b + 'o' + b.toLowerCase() : b), '')
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 resolution;
#define PI 3.1415926535898
#define EPS 0.01
const float clipFar = 100.0;
const float scaler = 1.0;
@leinonen
leinonen / tiny-raymarcher.frag
Created October 1, 2018 21:45
small raymarcher. nothing fancy
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 resolution;
#define PI 3.1415926535898
#define EPS 0.01
const float clipFar = 16.0;