Skip to content

Instantly share code, notes, and snippets.

View thegoleffect's full-sized avatar

Van Nguyen thegoleffect

View GitHub Profile
sequenceDiagram
User->>+User Portal: Request DSAR
User Portal->>+Airflow: Initiate Processing
User Portal->>+DSAR Orchestration: API:Create DSAR
Airflow->>+DSAR Orchestration: API:Populate UserIds
Airflow->>+DSAR Orchestration: API:Broadcast Jobs
DSAR Orchestration->>+DSAR Processors: API:createJob
DSAR Processors->>+AWS S3: Upload CSV
Airflow->>+DSAR Orchestration: Poll Status (Cron)
DSAR Processors->>-DSAR Orchestration: Processing Completed
@thegoleffect
thegoleffect / TurnipPrices.cpp
Created June 2, 2020 22:30 — forked from Treeki/TurnipPrices.cpp
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
var React = require('react/addons'),
TestUtils = React.addons.TestUtils,
TestContext = require('./TestContext'),
App = require('./App.jsx'),
app = TestContext.getRouterComponent(App);
describe('App', function() {
it('has something', function() {
expect(app.getDOMNode().textContent).toContain('something');
});
@thegoleffect
thegoleffect / ldapjs-usage.js
Created August 21, 2014 21:24
basic ldapjs usage example
var LDAP = require('ldapjs');
var protocol = "ldap://";
var host = "...";
var post = 3268;
var dn = "cn=Van Nguyen,...";
var password = "some password";
var client = LDAP.createClient({
url: protocol + host + ":" + port
@thegoleffect
thegoleffect / simple-rot13-stream.js
Last active August 29, 2015 14:02
Simple ROT13 Stream
var Stream = require('stream');
var Util = require('util');
/*
To Use:
var rot13 = new ROT13Stream();
streamOne.pipe(rot13).pipe(process.stdout); // takes readstream streamOne, modifies with rot13, pipes into stdout
*/
define([
], function() {
return {
componentDidMount: function() {
this._boundForceUpdate = this.forceUpdate.bind(this, null);
this.getBackboneObject().on("all", this._boundForceUpdate, this);
},
componentWillUnmount: function() {
this.getBackboneObject().off("all", this._boundForceUpdate);
},
# run this as root
while [ 1 ]; do echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload; done
# or as an upstart job
script
echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload
end script
respawn
# now any process can run this or do the equivalent with sockets to trigger reload
%% Read image and convert to grayscale
img = imread('pic.jpg');
img = rgb2gray(img);
%% Define grayscale representations of 0-255
chars = fliplr([' ', '.', ',', ':', '-', '=', '+', '*', '#', '%', '@']);
step = 256 / 11;
%% Cut image so its size is 8*w times 13*h
imgSize = size(img);
import mechanize
from bs4 import BeautifulSoup
from datetime import datetime
TGT_DATE = 'MONTH DAY, YEAR' #i.e. 'September 30, 2014'
OFFICE_ID = '503' # officeid for SF DMV. See HTML code for other office ids
NUMBERITEMS = 'Num' # number of tasks for dmv; should be between 1-3
FIRSTNAME = 'FIRST_NAME'
LASTNAME = 'LAST_NAME'
# Number looks like (TELAREA) TELPREFIX-TELSUFFIX