A Pen by Sher Minn Chong on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Write a program that prints out the numbers 1 to 100 (inclusive). | |
// If the number is divisible by 3, print Crackle instead of the number. | |
// If it's divisible by 5, print Pop. If it's divisible by both 3 and 5, print CracklePop. | |
// Note, process.stdout.write prints without newline | |
for(var i = 1; i <= 100; i++){ | |
if(i % 3 == 0){ | |
process.stdout.write('Crackle'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Task: Depth-first searcher | |
class Node(): | |
def __init__(self, id): | |
self.id = id | |
self.children = [] | |
def add_child(self, node): | |
self.children.append(node) | |
def __repr__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
EMPTY = '-' | |
PLAYER_X = 'X' | |
PLAYER_O = 'O' | |
def init_board(n): | |
board = {} | |
for x in range(n): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char_map = ['#', '=', '-', '.'] | |
def flood(grid, node, target, depth): | |
x, y = node | |
color = char_map[depth] if depth < len(char_map) else None | |
if target == color: | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, redirect, url_for, jsonify | |
import requests | |
import urllib.parse | |
import os | |
app = Flask(__name__) | |
app.config.from_envvar('RC_OAUTH_CLIENT_SECRETS') | |
app.config['RC_OAUTH_AUTH_URI'] = 'http://recurse.com/oauth/authorize' | |
app.config['RC_OAUTH_TOKEN_URI'] = 'http://recurse.com/oauth/token' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command prompt: | |
cmd+p | |
package command prompt: | |
cmd+shift+p | |
select lines: | |
shift+ up/down | |
moving lines: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onGLC(glc) { | |
glc.loop(); | |
// glc.size(400, 400); | |
// glc.setDuration(5); | |
// glc.setFPS(20); | |
// glc.setMode('single'); | |
// glc.setEasing(false); | |
var list = glc.renderList, | |
width = glc.w, | |
height = glc.h, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onGLC(glc) { | |
glc.loop(); | |
// glc.size(400, 400); | |
glc.setDuration(4); | |
// glc.setFPS(20); | |
glc.setMode('single'); | |
glc.setEasing(false); | |
var list = glc.renderList, | |
width = glc.w, | |
height = glc.h, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onGLC(glc) { | |
glc.loop(); | |
// glc.size(400, 400); | |
glc.setDuration(3); | |
// glc.setFPS(20); | |
glc.setMode('single'); | |
glc.setEasing(false); | |
var list = glc.renderList, | |
width = glc.w, | |
height = glc.h, |
OlderNewer