Skip to content

Instantly share code, notes, and snippets.

View eklitzke's full-sized avatar

Evan Klitzke eklitzke

View GitHub Profile
#include <iostream>
int main() {
for (int i = 20; i--; ) {
std::cout << i << "\n";
}
return 0;
}
package main
import "fmt"
func isValid(x int) bool {
s := 0
for y := 1; y <= 0x2000; y <<= 1 {
if x&y == 0 {
// 0-bit means open paren, push the stack
s++
package main
import "fmt"
func isValid(x int) bool {
b := 0
s := 0
for y := 1; y <= x; y <<= 1 {
if x&y == 0 {
s++

Problem Statement

A group of N pirates buries a treasure chest, where N is an odd number. The treasure chest is locked with multiple locks. For each lock, you may have any number of copies of the key that opens that lock. Each of the pirates receives one or more keys. The goal is to design a scheme where if any minority group (less than half) of the pirates come together, it's guaranteed that they do not have all of the keys needed to open the locks on the chest. At the same time, any majority group (more than half) of the pirates is guaranteed to have enough keys to open all of the locks. For example, if there are 11 pirates, the keys

// App.js
import React, { Component } from 'react';
class App extends Component {
state = {
todos: []
};
async componentDidMount() {
try {
$ ssh otd
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-1015-gcp x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Fri Sep 21 06:17:42 UTC 2018
System load: 0.4 Processes: 136
for e in ${_environment}; do
eval "export $e"
done
// PushType represents a value that can be pushed into the hierarchy.
type PushType map[string]interface{}
func init() {
gob.Register(PushType{})
}
var errBadPushCast = errors.New("bad push cast")
// go is so fucking stupid
@eklitzke
eklitzke / console.txt
Created May 26, 2018 19:41
firebase errors
evan@bitcoin ~/code/firepad (master) $ npm install grunt-cli bower
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN notice [SECURITY] lodash has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=2.4.2 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] minimatch has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=minimatch&version=0.3.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN firepad@1.4.0 No license field.
+ grunt-cli@0.1.13
+ bower@1.8.4
added 12 packages in 4.044s
evan@slowpoke ~ $ coredumpctl gdb gdb
PID: 2502 (gdb)
UID: 1000 (evan)
GID: 1000 (evan)
Signal: 11 (SEGV)
Timestamp: Tue 2018-05-22 12:11:55 PDT (56s ago)
Command Line: gdb -p 2436
Executable: /usr/libexec/gdb
Control Group: /user.slice/user-1000.slice/user@1000.service/gnome-terminal-server.service
Unit: user@1000.service