Skip to content

Instantly share code, notes, and snippets.

View mogetutu's full-sized avatar

Isaak Mogetutu mogetutu

View GitHub Profile
@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 / 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 / .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

@mogetutu
mogetutu / counter.js
Created March 17, 2017 06:44 — forked from yuya-takeyama/counter.js
Closure examples.
// This works on Rhino.
var counter = (function () {
var i = 1;
return function () {
return i++;
};
})();
print(counter()); // 1
@mogetutu
mogetutu / deploy.rb
Created July 4, 2016 06:25
Deply Rails App with Puma and Nginx via Mina
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm' # for rvm support. (http://rvm.io)
set :domain, 'esdb.cn'
set :identity_file, '/User/somebody/.ssh/somebody.pem'
set :deploy_to, '/home/ubuntu/apps/xxx.com'
set :repository, 'ssh://git@bitbucket.org/somebody/xxx.com.git'
set :branch, 'master'
@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
*/