Skip to content

Instantly share code, notes, and snippets.

View gavinkalika's full-sized avatar

Gavin Kalikapersaud gavinkalika

View GitHub Profile
@gavinkalika
gavinkalika / array_versus_generators.php
Created March 29, 2023 02:26
Comparing the PHP 8.2 memory performance between array and generators
<?php
$size = 100000;
$startTime = microtime(true);
$memoryStart = memory_get_usage();
$array = range(1, $size);
$sum = 0;
brew cask reinstall vagrant
# this might take a long time
vagrant plugin update
@gavinkalika
gavinkalika / list.md
Created January 28, 2022 02:24 — forked from ih2502mk/list.md
Quantopian Lectures Saved
@gavinkalika
gavinkalika / mysql-docker.sh
Created March 5, 2018 13:14 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@gavinkalika
gavinkalika / bash-cheatsheet.sh
Created January 28, 2017 01:16 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@gavinkalika
gavinkalika / happy_git_on_osx.md
Created January 15, 2016 16:12 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

alias glog="git log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%ai) %C(bold blue)<%an>%Creset'"
@gavinkalika
gavinkalika / git
Created November 5, 2015 01:08 — forked from philpalmieri/git
git tips
git diff : compare current with staged (or with last commit if no staged one)
git diff —staged : compare staged with last commit
git diff <master>…<topicbr> : show diff introduced by topicbr comparing to master (base commit in master)
git diff <sha-1> : show diff betwheen latest commit of current branch and other commit (sha-1)
git log -n : view last n commits
git log -n -p : last n commits with summary of changes (diff)
git log -n —graph : graphical view branch history
git log —pretty=oneline : each commit at one line
git log <br1> —not <br2> : list commits which are in br1 but not in br2