Skip to content

Instantly share code, notes, and snippets.

View yawboakye's full-sized avatar
🛡️
mī videtur

yaw yawboakye

🛡️
mī videtur
View GitHub Profile
@yawboakye
yawboakye / abocco_must_win.rb
Created August 10, 2012 14:51
A win for @abocco in the GYAC
module GhanaYouthAwardsCeremony
extend self
def notify_aboccos_boys
(@candidates.values.max + 10).times { vote_for :abocco }
end
private :notify_aboccos_boys
def vote_for candidate
@candidates ||= Hash.new 0
@yawboakye
yawboakye / AirlineRes.java
Created October 14, 2012 13:36
A full of bugs, unoptimized Java code for a CLI airline reservation.. Everything was built to be static. You may make it better or use the methods elsewhere.
package airlinereservationsystem_yawboakyeyiadom;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.InputMismatchException;
import java.util.Scanner;
/**
(function () {
var script = document.getElementById('button');
var options = (decodeURIComponent(script.getAttribute('src').split('?')[1])).split('&');
var params = [];
var button = document.createElement('button');
for (var i=0, _len = options.length; i < _len; ++i) {
options[i] = options[i].split('=');
/* form validation for picket ticket buyer */
(function ($) {
$( function () {
var inputs = $('input');
var buyTicketButton = inputs.last();
@yawboakye
yawboakye / word-counter.html
Created May 24, 2013 16:15
Word Counter v0.0.1
<!doctype html>
<html>
<head>
<title>Count 'em</title>
<style>
* { margin:0; padding:0; }
div.wrap { width: 70%; margin: 5% auto; text-align: center; }
textarea { width: 100%; height: 200px; }
p { display: block; background-color: rgb(193, 202, 142);}
</style>
@yawboakye
yawboakye / json-traversor.js
Created May 28, 2013 14:16
Tiny recursive JSON traversal tool
// simple json traversal tool. *needs improvement*
var json = function (data, padding) {
var p = '';
if ( Object.prototype.toString.call(data) !== '[object Object]' ) {
for ( var i = 0; i < padding; ++i ) p += ' ';
console.log(p + data)
return
} else {
for ( var prop in data ) {
@yawboakye
yawboakye / bst.js
Last active December 17, 2015 23:59
Tiny binary search tree implementation in JavaScript (does not balance automatically)
// javascript implementation of a binary search tree
var BST = function ( val ) {
this.val = val;
this.lc = this.rc = null;
}
BST.prototype = {
constructor: BST,
@yawboakye
yawboakye / unused_but_cute_handles.py
Last active August 26, 2023 19:26
Which 3-letter handles are not owned on https://twitter.com? Doesn't mean you can have them
#!/usr/bin/env python3
def fof(handle):
try:
twitter_conn = http.client.HTTPSConnection('twitter.com')
twitter_conn.connect()
twitter_conn.request('GET', '/{}'.format(handle))
return twitter_conn.getresponse().status >= 400:
except:
return False

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@yawboakye
yawboakye / Mode.java
Last active December 23, 2015 15:29
I tried to find the mode of elements in an array without using any of Java Array's methods
import java.util.Arrays;
public class Mode {
private ModeOccurrence<Object, Integer> modeOccurrence;
Mode() {
this.modeOccurrence = new ModeOccurrence<>(null, -1);
}
public static void main(String[] args) {