Skip to content

Instantly share code, notes, and snippets.

View thing.js
const MongoClient = require('mongodb').MongoClient;
const url = "mongodb+srv:";
const prompt = require('prompt-sync')();
let db, dbo;
async function run() {
try {
perilstar / scraper.rb
Created May 6, 2018
Minecraft username scraper
View scraper.rb
module Scraper
@@lines, @@matches = [], []
def self.input(filename)
log =
log.each_line {|val| @@lines.push(val.encode("UTF-8"))}

the written out part

use case

You're a digital artist trying to make glitch artwork with pixel sorting. You're using Processing for this, because that's how everyone does it. However, you want to streamline more edits into your process, so you use this code to modify the hue, saturation, brightness, etc. of the image as you're sorting it.


I didn't see anyone else implement a gaussian blur function did you

how it uses the different things you asked for

perilstar / CodeMakesStatsEasier.js
Last active Dec 8, 2017
Analysis of procrastination data
View CodeMakesStatsEasier.js
const _ = require('underscore');
let a = `
Very often
Very often
View dark_aerogel.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
View Encrypty thing.cpp
using namespace std;
char encryptChar(char c, int key) {
key %= 52
if (c < 65 || (c > 90 && c < 97) || c > 122) { // don't encrypt non-letters
return c;
if (65 <= c && c <= 90 && c+key>90) { // handling the middle bit
c += 7;
View Point.pde
class Point {
private float x, y;
private float direction;
public float speed;
Point() {
this.x = mouseX;
this.y = mouseY;
this.direction = 0;
View Toaster.rb
def toaster str
case str
when "bread"
when "toast"
"extra crispy toast"
when "bagel"
when "poptart"
"cooked poptart"
perilstar / Ruby: PBR vs PBV and data mutability.rb
Created Aug 15, 2017
Ruby: PBR vs PBV and data mutability created by ekyl -
View Ruby: PBR vs PBV and data mutability.rb
# In this document, I'll be going over a few important concepts
# that you need to be able to understand in Ruby. The first is that of
# Pass-By-Value vs Pass-By-Reference. This is closely tied to another
# concept: mutability. First, I'll show a brief demonstration of what
# I mean.
number = 1
array = [1,2,3]
perilstar /
Created Jan 25, 2017
In theory, find full house in a set of arbitrary ints
public class Main {
public static void main(String[] args)
int[] a = new int[]{1,1,2,5,2,1,4};
System.out.println(hasFullHouse(a)?"Full house!":"Better luck next time");