Skip to content

Instantly share code, notes, and snippets.

@sk187
sk187 / floor_vs_point_division.py
Last active April 4, 2016 16:36
Floor vs Float Point Division in Python 3
# Floating Point Division
231871064940156750 / 5
# => 4.637421298803135e+16
# Turn the result into a integer
int(4.637421298803135e+16)
# => 46374212988031352
# Floor Division
231871064940156750 // 5
# => 46374212988031350
@sk187
sk187 / Gemfile
Last active February 28, 2016 19:55 — forked from caseywatts/Gemfile
Sinatra on Cloud9
source 'https://rubygems.org'
gem 'sinatra'
gem 'sinatra-contrib'
gem 'json'
@sk187
sk187 / fizzbuzz.rb
Last active February 28, 2016 18:11
fizzbuzz Challenge
def fizzbuzz(x)
# your
# code
# goes
# here
puts "(change me I am a placeholder string)"
end
@sk187
sk187 / rpusb.sh
Created December 25, 2015 17:45
raspberry pi console usb
screen /dev/cu.usbserial 115200
@sk187
sk187 / rubocoprvm.cson
Last active January 14, 2016 19:42
config.cson for rubocop rvm
# This is what your probably have
"linter-rubocop":
command: "/Users/sungkim/.rvm/gems/ruby-2.2.3/bin/rubocop"
# This is what you should have
# Notice that the bin was changed to wrapper
"linter-rubocop":
command: "/Users/sungkim/.rvm/gems/ruby-2.2.3/wrappers/rubocop"
# The first line will get all hidden folders and Files to be shown
# The second line will close and reopen Finder windows so the changes will
# take effect.
defaults write com.apple.finder AppleShowAllFiles YES
killall Finder
# To hide the files/folders once more
defaults write com.apple.finder AppleShowAllFiles NO
killall Finder
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
# Into your temrminal type
which ruby # This will give you the path to where ruby is installed if installed
ruby -v # This will give you the version of ruby you currently have installed
# You can check just about any other program in the same fashion
which git
git -v
brew install git # This will install the latest version of Git into your Homebrew Cellar
# First type this into your terminal. *You must already have homebrew installed
brew install ruby
# After installing ruby, we need to edit the path on your computer so it uses
# the new installation of ruby and not the one packaged with your computer.
# Type the following into your terminal to edit the paths with VIM
sudo vi /etc/paths
# It will ask for your password (the one you used to login / install programs)
# Just type it in and press enter *You will not see anything but you are entering something I promise.