Skip to content

Instantly share code, notes, and snippets.

import json
import random
from datetime import datetime, timedelta, timezone
def random_date_in_past_months(months):
now = datetime.now()
start_date = now - timedelta(days=months * 30)
random_days = random.randint(0, months * 30)
random_date = start_date + timedelta(days=random_days)
random_timezone = timezone(timedelta(minutes=random.randint(-720, 720)))
@gremax
gremax / trim_enabler.txt
Created July 16, 2022 21:07 — forked from return1/trim_enabler.txt
TRIM Enabler for OS X Yosemite 10.10.3
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/

Keybase proof

I hereby claim:

  • I am gremax on github.
  • I am gremax (https://keybase.io/gremax) on keybase.
  • I have a public key ASBOJb7XC2I81C9vYdP1PR2iyJw4P_66ikpe8vzA65ZDOgo

To claim this, I am signing this object:

@gremax
gremax / latency.txt
Created December 28, 2017 17:25 — forked from andriisoldatenko/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@gremax
gremax / gems.rb
Created November 22, 2015 14:23 — forked from Ptico/gems.rb
My default rails gemfile
source 'https://rubygems.org'
BUNDLE_RAILS_VERSION = '~> 4.2.4'
# Rails
gem 'railties', BUNDLE_RAILS_VERSION
gem 'activesupport', BUNDLE_RAILS_VERSION
gem 'actionpack', BUNDLE_RAILS_VERSION
gem 'actionmailer', BUNDLE_RAILS_VERSION
gem 'activejob', BUNDLE_RAILS_VERSION
@gremax
gremax / vagrant.md
Created November 13, 2015 11:49 — forked from the-teacher/vagrant.md
Vagrant.startup

HOST MACHINE

  brew cask install virtualbox
  brew cask install vagrant
  brew cask install vagrant-manager
  vagrant plugin install vagrant-vbguest