Skip to content

Instantly share code, notes, and snippets.

View codyhanson's full-sized avatar
🍻
Cheers

Cody Hanson codyhanson

🍻
Cheers
View GitHub Profile
@enpfeff
enpfeff / api.md
Last active March 12, 2018 19:52

Execution Of Code

Scope

This document is going to document the elusive nature of executing code from the builder to make it less elusive and easy to do. Also as the thin client continues to grow we need to make a migration towards a new pattern on how we execute code. So going forward this education should be helpful.

Issues

The main issue with the current model is that as we increase the uses of the platform the current code execution framework cannot scale as the platform scales. For example the current interface to the execution framework looks like.

@mcoffin
mcoffin / cleandocker
Last active September 26, 2015 00:12
cleandocker
#!/usr/bin/env bash
set -e
while getopts ":f" opt; do
case $opt in
f)
running_containers=$(docker ps -q)
if [ ! -z "$running_containers" ]; then
docker kill $running_containers
fi
@BonsaiDen
BonsaiDen / record.sh
Last active September 3, 2023 10:12
Record from Virtual Frame Buffer via ffmpeg
xvfb-run -s "-screen 0 1280x800x16" -e /dev/stdout -a /home/ivo/Desktop/foo.sh
./ffmpeg -r 30 -f x11grab -draw_mouse 0 -s 1280x800 -i :99 -c:v libvpx -quality realtime -cpu-used 0 -b:v 384k -qmin 10 -qmax 42 -maxrate 384k -bufsize 1000k -an screen.webm
# foo.sh
google-chrome --incognito --window-size=1280,800 --app=http://github.com
@anandsunderraman
anandsunderraman / setChromeOptions.js
Last active July 19, 2024 12:13
Selenium Web Driver Set Chrome Options
//import the selenium web driver
var webdriver = require('selenium-webdriver');
var chromeCapabilities = webdriver.Capabilities.chrome();
//setting chrome options to start the browser fully maximized
var chromeOptions = {
'args': ['--test-type', '--start-maximized']
};
chromeCapabilities.set('chromeOptions', chromeOptions);
var driver = new webdriver.Builder().withCapabilities(chromeCapabilities).build();
@vaskoz
vaskoz / builder.go
Last active January 22, 2024 10:54
Golang Builder pattern
package main
import "strconv"
import "fmt"
type Color string
type Make string
type Model string
const (
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 23, 2024 04:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@ross-nordstrom
ross-nordstrom / prepare-commit-msg
Last active December 30, 2015 23:59
This goes in `.git/hooks/prepare-commit-msg`. Be sure to chmod +x it. It adds the user story id to every commit based on branch name. Intended for Pivotal tracker, but can be modified for other syntaxes.
#!/bin/sh
#
# Automatically add branch name and branch description to every commit message except merge commit.
# Prefix commit messages with "[US1234]: ""
#
COMMIT_EDITMSG=$1
addBranchName() {
branchPath=$(git symbolic-ref -q HEAD)
@grantslatton
grantslatton / fizzbuzz.c
Last active August 19, 2022 11:20
FizzBuzz solved using only bit twiddling. It essentially uses two deterministic finite automata for divisibility testing.
#include <stdio.h>
int f0(unsigned int x) { return x? (x&(1<<31)? f1(x<<1) : f0(x<<1)) : 1; }
int f1(unsigned int x) { return x? (x&(1<<31)? f3(x<<1) : f2(x<<1)) : 0; }
int f2(unsigned int x) { return x? (x&(1<<31)? f0(x<<1) : f4(x<<1)) : 0; }
int f3(unsigned int x) { return x? (x&(1<<31)? f2(x<<1) : f1(x<<1)) : 0; }
int f4(unsigned int x) { return x? (x&(1<<31)? f4(x<<1) : f3(x<<1)) : 0; }
int t0(unsigned int x) { return x? (x&(1<<31)? t1(x<<1) : t0(x<<1)) : 1; }
int t1(unsigned int x) { return x? (x&(1<<31)? t0(x<<1) : t2(x<<1)) : 0; }
int t2(unsigned int x) { return x? (x&(1<<31)? t2(x<<1) : t1(x<<1)) : 0; }
# !/usr/python
# The FIN scan utilizes the FIN flag inside the TCP packet,
# along with the port number to connect to on the server.
# If there is no response from the server, then the port is open.
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
@cpq
cpq / embed.c
Last active May 15, 2024 17:20
How to embed data files into C/C++ executable
// Copyright (c) Sergey Lyubka, 2013.
// All rights reserved.
// Released under the MIT license.
// This program is used to embed arbitrary data into a C binary. It takes
// a list of files as an input, and produces a .c data file that contains
// contents of all these files as collection of char arrays.
// Usage:
// 1. Compile this file:
// cc -o embed embed.c