Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mogetutu's full-sized avatar

Isaak Mogetutu mogetutu

View GitHub Profile
@mogetutu
mogetutu / osx_mysql_ownership_fix
Created April 22, 2012 23:16
'warning the user/local/mysql/data directory is not owned by the mysql user', you have to:
sudo chown -RL root:mysql /usr/local/mysql
sudo chown -RL mysql:mysql /usr/local/mysql/data
sudo /usr/local/mysql/support-files/mysql.server start
@mogetutu
mogetutu / install-node-js.sh
Created March 11, 2020 08:53 — forked from ankurk91/install-node-js.sh
Install node-js, npm and yarn on Ubuntu/Mac using nvm
#!/bin/sh
# Install node and npm via nvm - https://github.com/nvm-sh/nvm
# Run this script like - bash script-name.sh
# Define versions
INSTALL_NODE_VER=12
INSTALL_NVM_VER=0.35.2
@mogetutu
mogetutu / Install.txt
Created October 1, 2019 03:06 — forked from soderlind/Install.txt
macOS DoH! (DNS over HTTPS) using cloudflared
1) Install cloudflared using homebrew:
brew install cloudflare/cloudflare/cloudflared
2) Create /usr/local/etc/cloudflared/config.yaml, with the following content
proxy-dns: true
proxy-dns-upstream:
- https://1.1.1.1/dns-query
- https://1.0.0.1/dns-query
@mogetutu
mogetutu / MY_Model_access
Created April 15, 2012 11:00
Use of Codeigniter MY_Model functions
<?php
$row = $this->article_model->get(2);
//stdClass Object ( [body] => Fuzzy Wuzzy was a bear; Fuzzy Wuzzy had no hair. Fuzzy Wuzzy wasn't very fuzzy, was he? [title] => Fuzzy Wuzzy [id] => 2 )
//SELECT * FROM (`articles`) WHERE `id` = 2
$row = $this->article_model->get_by('title', 'Fuzzy Wuzzy');
//stdClass Object ( [body] => Fuzzy Wuzzy was a bear; Fuzzy Wuzzy had no hair. Fuzzy Wuzzy wasn't very fuzzy, was he? [title] => Fuzzy Wuzzy [id] => 2 )
//SELECT * FROM (`articles`) WHERE `title` = 'Fuzzy Wuzzy'
// NOTE: if more than 1, returns first
@mogetutu
mogetutu / nginx.conf
Created August 3, 2018 16:22 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# Advanced config for NGINX
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
cf80fc2bf91c57b8b65197a54b107208f09233a3
@mogetutu
mogetutu / ETagMiddleware.php
Created July 3, 2016 21:57
ETag middleware laravel 5
<?php namespace App\Http\Middleware;
use Closure;
class ETagMiddleware {
/**
* Implement Etag support
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
@mogetutu
mogetutu / .zshrc
Created October 26, 2017 21:51 — forked from Anahkiasen/.zshrc
export ZPLUG_HOME=/usr/local/opt/zplug
source $ZPLUG_HOME/init.zsh
# Plugins
zplug "lib/completion", from:oh-my-zsh
zplug "lib/directories", from:oh-my-zsh
zplug "lib/functions", from:oh-my-zsh
zplug "plugins/brew-cask", from:oh-my-zsh
zplug "plugins/brew", from:oh-my-zsh
zplug "plugins/composer", from:oh-my-zsh
@mogetutu
mogetutu / timer_helpers.php
Created July 31, 2017 15:01 — forked from calebporzio/timer_helpers.php
A simple helper function and macro for timing php scripts and eloquent queries
<?php
// Helper function.
if (! function_exists('timer')) {
function timer($expression)
{
$start = microtime(true);
if ($expression instanceof Closure) {
$expression();

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