Skip to content

Instantly share code, notes, and snippets.

View pythonicrubyist's full-sized avatar

Ramtin Vaziri pythonicrubyist

View GitHub Profile
@pythonicrubyist
pythonicrubyist / delete_git_commit
Created February 25, 2014 18:43
Deleting the last Git commit
git reset --hard HEAD~1
git push origin HEAD --force
@pythonicrubyist
pythonicrubyist / ruby_env_setup_on_os x_mavericks
Last active August 29, 2015 14:01
Ruby Development Environment Setup on OS X Mavericks
# Instlled Xcode, Github and Sublime Text 3 by runing their installation packages.
git config --global user.name "Your Full Name"
git config --global user.email "Your Email Address"
# Homebrew Installation:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew doctor
echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile
@pythonicrubyist
pythonicrubyist / redis_on_osx_mavericks
Created May 28, 2014 15:42
redis on Mac OSX Mavericks
# installing redis server
mkdir /usr/local/var/log
mkdir /usr/local/var/db
brew install redis
# start redis server
redis-server /usr/local/etc/redis.conf
@pythonicrubyist
pythonicrubyist / variables_in_swift
Created February 11, 2015 17:17
Variables in Swift
// Variables in Swift
// Every variable in Swift is declared with the keyword "var".
// Swift is a type-safe language. It is strongly typed.
// All varables is Swift are of a specific type.
// Swift performs type inference if the type is not declared.
var s = "Hello World!" // Type inferred as string
var i = 7 // Type inferred as integer
var b = false // Type inferred as boolean
@pythonicrubyist
pythonicrubyist / control_flow_ in_swift
Last active August 29, 2015 14:15
Control Flow in Swift
// Playground - noun: a place where people can play
import UIKit
// Flow management in Swift
// Parentheses are optional, curly braces are mandatory.
// condition must evaluate as a boolean.
var a = 5
var b = 10
@pythonicrubyist
pythonicrubyist / collections_in_swift
Last active August 29, 2015 14:15
Collections in Swift
// Collections in Swift
// Two basic collection types in Swift, Arrays and Dictionaries.
// Arrays in Swift
// Ordered collections of items
// Zero based.
// Type safe
// If defined by let, it is immutable, can not be added or altered.
@pythonicrubyist
pythonicrubyist / swift_fundamentals
Last active August 29, 2015 14:16
Swift Fundamentals
// Variables in Swift
// Every variable in Swift is declared with the keyword "var".
// Swift is a type-safe language. It is strongly typed.
// All varables is Swift are of a specific type.
// Swift performs type inference if the type is not declared.
var s = "Hello World!" // Type inferred as string
var i = 7 // Type inferred as integer
var b = false // Type inferred as boolean
@pythonicrubyist
pythonicrubyist / iOS_dev_swift_notes
Last active August 29, 2015 14:16
IOS developments with Swift
// Actions are method invocations from View to View Controller.
// Outlets are method invocations from View Controller to view.
// Initial Setup for ViewControllers
// ViewDidLoad - Called when you create the class and load from xib. Great for initial setup and one-time-only work.
// ViewWillAppear - Called right before your view appears, good for hiding/showing fields or any operations that you want to happen every time before the view is visible. Because you might be going back and forth between views, this will be called every time your view is about to appear on the screen.
// ViewDidAppear - Called after the view appears - great place to start an animations or the loading of external data from an API.
// ViewWill/DidDisappear - Same idea as WillAppear.
// ViewDidUnload/ViewDidDispose - In Objective C, this is where you do your clean-up and release of stuff, but this is handled automatically so not much you really need to do here.
@pythonicrubyist
pythonicrubyist / handy_linux_commands
Created October 30, 2013 16:30
Handy Linux Commands
ls *.txt | wc -l | tee /dev/tty count.txt
@pythonicrubyist
pythonicrubyist / convert_ubuntu_mint_to_python_dev_env
Last active December 29, 2015 00:59
Converting Ubuntu 12.04 LTS or LInux Mint 13 into a Python Developer’s Environment
sudo apt-get install python-pip
sudo apt-get install python-setuptools
sudo apt-get install python-dev
sudo apt-get install build-essential
sudo pip install virtualenv
sudo pip install virtualenvwrapper
sudo echo 'export WORKON_HOME=$HOME/.virtualenvs' >> ~/.bashrc
sudo echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bashrc