Skip to content

Instantly share code, notes, and snippets.

@saifabid
saifabid / evernotemassdelete.scpt
Created January 6, 2020 02:17
delete ALL notebooks from evernote
tell application "Evernote"
repeat with n1 in notebooks
delete n1
end repeat
end tell
git rm -r --cached .
git add .
git commit -m ".gitignore fix"
@saifabid
saifabid / unzip.py
Created May 12, 2019 03:37
Python unzip
import zipfile
zip_ref = zipfile.ZipFile(path_to_zip_file, 'r')
zip_ref.extractall(directory_to_extract_to)
zip_ref.close()
@saifabid
saifabid / docker-compose.yaml
Created April 14, 2018 20:48
A simple docker-compose file to get a go service running
version: '3'
services:
twitterhelp:
build:
context: .
image: twitterhelp:latest
ports:
- 3000:3000
@saifabid
saifabid / Dockerfile
Last active April 14, 2018 20:40
A simple dockerfile to get go program built and running.
FROM golang:1.9
# This is only so you can store it a proper go workspace layout
ENV dirPath $GOPATH/src/github.com/username/repo
RUN mkdir -p $dirPath
ADD . $dirPath
WORKDIR $dirPath
EXPOSE 3000

Keybase proof

I hereby claim:

  • I am saifabid on github.
  • I am saifabid (https://keybase.io/saifabid) on keybase.
  • I have a public key ASCQ0Isj6chDIoNd-qRb3AXOx_FEOOrL50fe1SnRYybJigo

To claim this, I am signing this object:

@saifabid
saifabid / main.go
Created December 25, 2016 06:58
[golang] Current Time in Canada/Eastern
func currentTime() string {
loc, _ := time.LoadLocation("Canada/Eastern")
return time.Now().In(loc).Format(time.Kitchen)
}
@saifabid
saifabid / Ruby_Rails_Naming_Conventions.md
Created September 23, 2016 00:58 — forked from alexpchin/Ruby_Rails_Naming_Conventions.md
Ruby & Rails Naming Conventions

Alex's Rails Cheat Sheet

I think the most confusing thing that I have found about Ruby on Rails so far has been the transition from (trying to) write code myself to the use of the fabled "Rails Magic". So, to help my own understanding of a few core Ruby on Rails concepts, I have decided to write something on what I think is a CRITICAL topic... the idea of Convention over Configuration and why (in my mind) it is the most important thing that helps Rails become magic!

(This may be a topic that we cover in more detail in class but as I said, I'm writing this for my own understanding... I hope it helps someone else understand things too... Perhaps you can give me a hand when I'm crying next week!)

##Convention over configuration ###What does this "actually" mean...

@saifabid
saifabid / feature_scale.py
Created May 30, 2016 03:35
simple feature scaling
def featureScaling(arr):
scaled_arr = []
max_val = max(arr)
min_val = min(arr)
if max_val == min_val:
return arr
denom = max_val - min_val
for val in arr:
new_val = float((val - min_val))/denom
@saifabid
saifabid / datadog.go
Last active May 24, 2016 22:21
Test s3 uploads -pub
package datadog
import (
"fmt"
"time"
"github.com/ooyala/go-dogstatsd"
)
// Statsd wraps the datadog interface