I hereby claim:
- I am mjgtwo on github.
- I am mjg2 (https://keybase.io/mjg2) on keybase.
- I have a public key ASC7ZLMeD-yAuD7W7Jz6eH564NtIpuvGt9lgIHCHZmcjIgo
To claim this, I am signing this object:
const parse = text => text.split("-").map(bound => +bound); | |
const range = (upperBound, lowerBound = 0) => | |
[...Array(upperBound - lowerBound).keys()] | |
.map(i => i + lowerBound) | |
.map(i => `${i}`); | |
const generate = bounds => range(bounds[1], bounds[0]); | |
const rule1 = /^0*1*2*3*4*5*6*7*8*9*$/; //number to the right is greater than or equal to previous number | |
const rule2 = /\d*(\d)\1\d*$/; //there is at least one duplicate neighbor | |
const rule3 = sequence => |
const parse = text => text.split(",").map(el => +el); | |
let backupMemory = parse(input); | |
const optCode = number => (a, b) => | |
({ | |
1: a + b, | |
2: a * b, | |
99: null | |
}[number]); | |
const readFromMemory = (memory, location) => memory[location]; | |
const writeToMemory = (memory, location, value) => (memory[location] = value); |
i1 = "R8,U5,L5,D3"; | |
i2 = "U7,R6,D4,L4"; | |
const dx = { L: -1, R: 1, U: 0, D: 0 }; | |
const dy = { U: -1, D: 1, R: 0, L: 0 }; | |
const parse = steps => steps.split(","); | |
const toString = pos => `${pos[0]},${pos[1]}`; | |
wire1 = parse(i1); | |
wire2 = parse(i2); | |
length = 0; | |
x = 0; |
#!/bin/bash | |
# usage: $wf "mynetworkname" | |
security find-generic-password -ga "$1" | grep "password:" |
// ./counter/types.ts | |
export interface CounterState { | |
value: number; | |
} | |
export const INCREMENT_COUNTER = "INCREMENT_COUNTER"; | |
export const DECREMENT_COUNTER = "DECREMENT_COUNTER"; | |
export const RESET_COUNTER = "RESET_COUNTER"; |
type aggregateFn<T> = (...args: T[]) => T; | |
interface curryFn<T> extends aggregateFn<T> { | |
(...args: T[]): curryFn<T>; | |
} | |
const curry = <T>(fn: aggregateFn<T>): curryFn<T> => ( | |
...args: any[] | |
): curryFn<any> | any => | |
args.length ? curry(fn.bind.apply(fn, [undefined].concat(args))) : fn(); |
#!/bin/bash | |
if [[ $(($RANDOM % 5)) = 0 ]] | |
then git fetch; clear; echo "Fetched"; | |
else | |
clear; | |
fi | |
echo 'Branches:' | |
git branch; |
const lut: string[] = []; | |
for (let i = 0; i < 256; i++) { | |
lut[i] = (i < 16 ? '0' : '') + i.toString(16); | |
} | |
/* | |
* Fast UUID generator, RFC4122 version 4 compliant. | |
* @author Jeff Ward (jcward.com). | |
* @license MIT license |
I hereby claim:
To claim this, I am signing this object:
import logging | |
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)#Surpress's small errors from Scapy | |
from scapy.all import * | |
def arp_display(pkt): | |
if pkt.haslayer(ARP): #makes sure it is ARP | |
if pkt[ARP].op == 1: #who-has (request) | |
if pkt[ARP].psrc == '0.0.0.0': # ARP Probe | |
print "ARP Probe from: " + pkt[ARP].hwsrc |