Skip to content

Instantly share code, notes, and snippets.

🌆
i continue to work. the city sleeps.

Erin Moon barzamin

🌆
i continue to work. the city sleeps.
Block or report user

Report or block barzamin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View regexes.rs
#![allow(dead_code)]
use regex::{Regex, RegexBuilder};
static CTRL_CHARS: &str = r"\x00-\x1F\x7F";
static INVALID_CHARS: &str = "\u{FFFE}\u{FEFF}\u{FFFF}\u{202A}-\u{202E}";
static UNICODE_SPACES: &str = "\u{09}-\u{0D}\u{20}\u{85}\u{A0}\u{1680}\u{180E}\u{2000}-\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}";
static LATIN_ACCENTS: &str = "\u{00C0}-\u{00D6}\u{00D8}-\u{00F6}\u{00F8}-\u{00FF}\u{0100}-\u{024F}\u{0253}-\u{0254}\
\u{0256}-\u{0257}\u{0259}\u{025b}\u{0263}\u{0268}\u{026F}\u{0272}\u{0289}\u{02BB}\u{1E00}-\u{1EFF}";
static PUNCTUATION: &str = r##"-_!"#$%&'()*+,./:;<=>?@\[\]^`{|}~"##;
View keybase.md

Keybase proof

I hereby claim:

  • I am barzamin on github.
  • I am er1n (https://keybase.io/er1n) on keybase.
  • I have a public key ASBGM6pIaiBnGcv7QvY5gqnhIf9cqGJm7oJUKx8ug82D5wo

To claim this, I am signing this object:

View dev.js
/// thanks to @no_boot_device@twitter.com
webpackJsonp([0],[function(n,b,d){mArr=d.m,mCac=d.c,mCar=[],Object.keys(mCac).forEach(function(n){mCar[n]=mCac[n]}),findFunc=function(n){if(results=[],"string"==typeof n)mArr.forEach(function(r,t){-1!==r.toString().indexOf(n)&&results.push(mCac[t])});else{if("function"!=typeof n)throw new TypeError("findFunc can only find via string and function, "+typeof n+" was passed");modArray.forEach(function(r,e){n(r)&&results.push(t.c[e])})}return results},findCache=function(n){if(results=[],"function"==typeof n)mCar.forEach(function(r,t){n(r)&&results.push(r)});else{if("string"!=typeof n)throw new TypeError("findCache can only find via function or string, "+typeof n+" was passed");mCar.forEach(function(r,t){if("object"==typeof r.exports)for(p in r.exports)if(p==n&&results.push(r),"default"==p&&"object"==typeof r.exports["default"])for(p in r.exports["default"])p==n&&results.push(r)})}return results},window.wc={get:d,modArr:mArr,modCache:mCac,modCArr:mCar,findFunc:findFunc,find
View gist:9a819a393911e78612d2ee4236361456
vec4 viridis(float x) {
const float e0 = 0.0;
const vec4 v0 = vec4(0.26666666666666666,0.00392156862745098,0.32941176470588235,1);
const float e1 = 0.13;
const vec4 v1 = vec4(0.2784313725490196,0.17254901960784313,0.47843137254901963,1);
const float e2 = 0.25;
const vec4 v2 = vec4(0.23137254901960785,0.3176470588235294,0.5450980392156862,1);
const float e3 = 0.38;
const vec4 v3 = vec4(0.17254901960784313,0.44313725490196076,0.5568627450980392,1);
const float e4 = 0.5;
View serial.rs
use arch::x86_64::ports::Port;
use core::fmt;
use spin::RwLock;
lazy_static! {
pub static ref COM1: RwLock<SerialPort> = RwLock::new(SerialPort::new(0x3f8));
}
pub struct SerialPort {
data_port: Port<u8>,
View colormaps.glsl
/// a collection of cool colormaps in glsl
/// most work on [0, 1].
///
/// Lovingly ripped off from:
/// * halcy
/////////////////////////////////////////////////////////////////
// WAHas Spectrum analyzer palette
// ripped off from https://www.shadertoy.com/view/MstSzj
@barzamin
barzamin / discord_auth.py
Created Jun 5, 2017
Discord auth blueprint for Flask
View discord_auth.py
from requests_oauthlib import OAuth2Session
from flask import Blueprint, request, redirect, abort, flash, url_for, session
from flask_login import login_user, logout_user, login_required
from www import app, db, login_manager
from .models import User
from .utils import is_safe_redirect
API_BASE_URL = 'https://discordapp.com/api'
OAUTH2_CLIENT_ID = app.config['DISCORD_CLIENT_ID']
View faceapp.py
#!/usr/bin/python2
import requests
import os
import sys
import random
import string
FILTERS = [
"smile",
"smile_2",
View tgpnotes0.md

this is going to be a review of the current genesis demo build by erin/barzamin/The Refactor Godess/The Really Annoying Nitpicker

ok lets boot it up bluh

wine Genesis.exe

cool it runs ok under wine

let's do "good" graphics quality, and make it windowed

@barzamin
barzamin / GeometryLib.java
Last active Aug 15, 2016
Processinglang/Java computational geometry utils
View GeometryLib.java
import megamu.mesh.*;
static class GeomUtils {
static PVector centroid(MPolygon polygon) {
return centroid(toVectorArray(polygon.getCoords()));
}
static PVector centroid(PVector[] polygon) {
int l = polygon.length;
float a = signedArea(polygon);
You can’t perform that action at this time.