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 __future__ import division | |
import sys, pygame, time | |
import numpy as N | |
import pygame.surfarray as surfarray | |
pygame.init() | |
size = width, height = 1024,768 | |
xlength,xoffset = 3.5, -2.5 |
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
"""CONVENTIONS: | |
positions are done row-column from the bottom left and are both numbers. This corresponds to the alpha-number system in traditional chess while being computationally useful. they are specified as tuples | |
""" | |
import itertools | |
WHITE = "white" | |
BLACK = "black" | |
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
def normalize(plainString,scrambledAlphabet): | |
plainString = plainString.upper().replace("J","I") | |
for letter in plainString: | |
if letter not in scrambledAlphabet: | |
plainString = plainString.replace(letter,'') | |
#print(plainString) | |
return plainString |
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
def encodingDict(scrambledAlphabet): | |
adfgvxIndex = ['A','D','F','G','V','X'] | |
encodeDict = {} | |
for i in range(0,6): | |
for j in range(0,6): | |
encodeDict[scrambledAlphabet[i*6+j]] = adfgvxIndex[i]+adfgvxIndex[j] | |
return encodeDict | |
def DecryptOnSpace(encryptedString,codeWord): |
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 Image,sys,struct,time,os | |
BLACK,WHITE = 0,1 | |
def rasterToImg(name,width,height,directions): | |
name,ext = os.path.splitext(name) | |
arr = [WHITE for j in range(0,width*height)] | |
x,y = 0,0 | |
size = width,height | |
dic = {"N":(0,-1), "S" : (0,1) , "E" : (1,0), "W" : (-1,0)} |
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
#!/usr/bin/bash | |
# after running whichever modprobe fbtft_device command | |
sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 livestreamer twitch.tv/$1 mobile --yes-run-as-root -v -p 'mplayer --nosound --noass --no-autosub --no-lirc --no-mouseinput --no-mouseinput -vo sdl' |
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
#!/usr/bin/env ruby | |
top = ['this looks awesome! ', 'this is excellent!', 'My eyes, they can\'t handle the glory!', 'but soft! what code through yonder window breaks?', 'Stellar!', 'Radical dude!', 'Perfect! I love it!'] | |
bottom = ['You got it, dude!', 'keep rockin, pal!', 'But that\'s just a small suggestion.', 'But everything else is wonderful!', 'But I love how everything else looks!'] | |
puts [top.sample, ARGV.join(' '), bottom.sample].join(' ') |
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 React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
const ConstantContext = React.createContext({}); | |
const ConstantConsumer = ConstantContext.Consumer; | |
export const ConstantProvider = ConstantContext.Provider; | |
export const ConstantConnect = (Wrappee) => { |
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
/* Copyright 2017 Brian Fong | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 2 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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
/* Good on you for modifying your layout! if you don't have | |
* time to read the QMK docs, a list of keycodes can be found at | |
* | |
* https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md | |
* | |
* There's also a template for adding new layers at the bottom of this file! | |
*/ | |
#include QMK_KEYBOARD_H |
OlderNewer