Skip to content

Instantly share code, notes, and snippets.

View andykais's full-sized avatar

Andrew Kaiser andykais

View GitHub Profile
FROM gcc:5
WORKDIR /usr/src/app
COPY torch /usr/src/app
RUN apt-get update
RUN apt-get dist-upgrade -y
RUN apt-get install -y sudo
RUN /bin/bash -c "./install-deps"
@andykais
andykais / await.js
Last active January 10, 2017 00:55
let listFiles = (folder: string) => listContents(folder, (f) => fs.statSync(f).isFile())
let listFolders = (folder: string) => listContents(folder, (f) => fs.statSync(f).isDirectory())
let listContents = (folder: string, filterFunc) => {
return new Promise(function (resolve, reject) {
fs.readdir(folder, function (error, result) {
if (error) {
reject(error)
} else {
yarn run v0.18.1
$ flow; test $? -eq 0 -o $? -eq 2
src/index.js:15
15: let files = await Promise.all(folders.map(async (name) => await listFiles(name)))
^^^^^^^^^^^^^^^^^^^^^ array type. This type is incompatible with
607: declare function $await<T>(p: Promise<T> | T): T;
^^^^^^^^^^^^^^ union: type application of identifier `Promise` | type parameter `T` of async return. See lib: /tmp/flow/flowlib_1ee65d0a/core.js:607
Member 1:
607: declare function $await<T>(p: Promise<T> | T): T;
^^^^^^^^^^ type application of identifier `Promise`. See lib: /tmp/flow/flowlib_1ee65d0a/core.js:607
#!/bin/bash
export DATE=$(date -d $(date +"%D") +"%s")
export FILENAME=/tmp/qod_$DATE.json
TITLE_TAG=~/bin/data/ascii_name.txt
urxvtc -e \
bash -c "\
. ~/bin/helpers/qod.sh \
&& qod \
@andykais
andykais / wgetter.sh
Created January 17, 2017 21:58
download manga from mangasee
#!/bin/bash
N=50
i=1
down_dir="$HOME/wget/Kingdom/"
while [ $i -lt $N ]; do
echo -==: downloading chapter $i :==-
# old locations
const React = require('react')
const handleClick = (event) => {
console.log('user clicked!')
console.log(event)
}
const ImageButton = (props) => (
<button onClick={() => handleClick(props.name)}>
<img src={props.src} alt=""/>

Algorithm Arsenal

  • sort
    • merge sort n log n
    • insertion sort
    • heap sort (n log n)
    • bubble sort n log n
  • graph search
    • DFS
    • BFS
  • shortest path - Djikstra's algorithm
@andykais
andykais / cisco.md
Last active February 22, 2017 18:59
  • how much mobility do we have in cisco? After a year am I able to try working on different things?

    • what I want out of this job is to be able to be in contact with multiple areas so I can keep learning, I don't want to get stagnant especially because in my last internship I really valued discovering things I didn't know how to do that helped me improve my code later.
  • how closely knit are teams? Do they hang out outside of work?

  • how much software goes back into the cisco? How much dogfooding do you do?

@andykais
andykais / my_tools.md
Last active March 8, 2017 02:18
cool new tech on the web

This is just really cool to me, service workers allow mobile websites to act like native

process.stdin.resume();
process.stdin.setEncoding('ascii');
var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;
process.stdin.on('data', function (data) {
input_stdin += data;
});