Skip to content

Instantly share code, notes, and snippets.

@sk187
sk187 / floor_vs_point_division.py
Last active Apr 4, 2016
Floor vs Float Point Division in Python 3
View floor_vs_point_division.py
# 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 Feb 28, 2016 — forked from caseywatts/Gemfile
Sinatra on Cloud9
View Gemfile
source 'https://rubygems.org'
gem 'sinatra'
gem 'sinatra-contrib'
gem 'json'
@sk187
sk187 / fizzbuzz.rb
Last active Feb 28, 2016
fizzbuzz Challenge
View fizzbuzz.rb
def fizzbuzz(x)
# your
# code
# goes
# here
puts "(change me I am a placeholder string)"
end
@sk187
sk187 / rpusb.sh
Created Dec 25, 2015
raspberry pi console usb
View rpusb.sh
screen /dev/cu.usbserial 115200
@sk187
sk187 / rubocoprvm.cson
Last active Jan 14, 2016
config.cson for rubocop rvm
View rubocoprvm.cson
# 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"
View hidden_files.sh
# 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
View regex-weburl.js
//
// 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
View check_ruby_git.sh
# 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
View install_git_homebrew.sh
brew install git # This will install the latest version of Git into your Homebrew Cellar
View install_homebrew_ruby_git.sh
# 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.
You can’t perform that action at this time.