Skip to content

Instantly share code, notes, and snippets.

View DataKinds's full-sized avatar
🏳️‍⚧️
owo

Tyler DataKinds

🏳️‍⚧️
owo
View GitHub Profile
@chemicalDictionary = { UUU: :phenylalanine, UUC: :phenylalanine, UUA: :leucine, UUG: :leucine,
CUU: :leucine, CUC: :leucine. CUA: :leucine, CUG: :leucine,
AUU: :isoleucine, AUC: :isoleucine, AUA: :isoleucine, AUG: :methionine,
GUU: :valine, GUC: :valine, GUA: :valine, GUG: :valine,
UCU: :serine, UCC: :serine, UCA: :serine, UCG: :serine,
CCU: :proline, CCC: :proline, CCA: :proline, CCG: :proline,
ACU: :threonine, ACC: :threonine, ACA: :threonine, ACG: :threonine,
GCU: :alanine, GCC: :alanine, GCA: :alanine, GCG: :alanine,
UAU: :tyrosine, UAC: :tyrosine, UAA: :stop, UAG: :stop,
CAU: :histidine, CAC: :histidine, CAA: :glutamine, CAG: :glutamine,
@DataKinds
DataKinds / mandelbrot.cpp
Created January 15, 2015 05:55
hacklebrot
#include <string>
#include <iostream>
#include <fstream>
#include <cmath>
#include <complex>
#include <algorithm>
int main(int argc, std::string argv[]) {
if (argc != 8) {
@DataKinds
DataKinds / gist:553379cf3fa93721664f
Created February 15, 2015 10:12
/dev/input/mice fun
miceFile = File.open("/dev/input/mice", "r")
mouseClickActions = { 0 => "- None\n\n",
1 => "- Left Mouse Button\n\n",
2 => "- Right Mouse Button\n\n" ,
3 => "- Left Mouse Button\n- Right Mouse Button\n\n",
4 => "- Middle Mouse Button\n\n",
5 => "- Left Mouse Button\n- Middle Mouse Button\n\n",
6 => "- Right Mouse Button\n- Middle Mouse Button\n\n",
7 => "- Left Mouse Button\n- Right Mouse Button\n- Middle Mouse Button\n\n" }
@DataKinds
DataKinds / main.rb
Last active August 29, 2015 14:15
corrupter
#!/usr/bin/env ruby
if ARGV.length != 1
puts "Please call this as \"ruby corrupt.rb <input file>\""
exit
end
def get_char
state = `stty -g`
`stty raw -echo -icanon isig`
@DataKinds
DataKinds / 3dvector.js
Last active August 29, 2015 14:23
3d vector library
var Vector = {};
Vector.Rect = function(x, y, z) {
this.magnitude = Math.sqrt(x^2, y^2, z^2);
this.toRect = function() { return this; }
this.toPolar = function() { return Vector.Polar(magnitude, Math.arccos(z/magnitude), Math.arcsin(y/magnitude)) }
this.x = x;
this.y = y;
this.z = z;
}
Vector.Polar = function(magnitude, rx, rz) {
@DataKinds
DataKinds / raytracer.html
Last active August 29, 2015 14:23
Raytracer
<html>
<head>
<title>Raytrace</title>
<script type="text/javascript" src="vector.js"></script>
<script type="text/javascript" src="raytracer.js"></script>
</head>
<body>
<canvas id="raytraceCanvas" width="100" height="100">
get off of internet explorer
</canvas>
// ==UserScript==
// @name Uploadius Hover Zoom
// @namespace uploadiushoverzoom
// @include http://swololol.com/*
// @version 1
// @grant none
// ==/UserScript==
window.onload = function() {
var title = document.getElementsByTagName("h1");
// ==UserScript==
// @name Uploadius Hover Zoom
// @namespace uploadiushoverzoom
// @include http://swololol.com/*
// @version 1
// @grant none
// ==/UserScript==
var title = document.getElementsByTagName("h1");
title[0].innerHTML = "<a style=\"text-decoration:none;color:#00f;\" href=\"http://swololol.com/ufi\">Uploadius (hoverzoom by @aearnus)</a>"
var links = document.getElementsByTagName("a");
@DataKinds
DataKinds / terrain.lua
Last active August 29, 2015 14:23
Roblox terrain generator
local areaSize = 700 --128
local brickSize = 4 --4
local noiseScale = 64 --32
local noiseMagnitude = 50 --50
local aboutHeight = 0.65 --0.65
local playerGenRadius = 128 --64
--the level indicates the bottom of the region
local snowLevel = 128
local snowBottom = 40 --snow is generated differently
@DataKinds
DataKinds / main.c
Last active August 29, 2015 14:24
C Math Parser
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <gmp.h>
#define VERBOSE_ONLY if(isVerbose)
int isVerbose = 0;