This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsof -wni tcp:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#check the current url to see if it matches the remote url | |
git remote -v | |
#update to new url with command | |
git remote set-url origin git@github.com:username/newreponame.git | |
#ls remote branches to confirm connection | |
git ls-remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch --index-filter 'git rm --cached --ignore-unmatch screenshot.png' -- --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum = 0 | |
(0...1000).each do |i| | |
sum += i if (i%3 == 0 || i%5 == 0) | |
end | |
puts "The sum total of all the multiples of 3 or 5 is #{sum}." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts 'Enter maximum range of Fibonacci sequence:' | |
num = gets.chomp.to_i | |
def fib(num) | |
sum = 0· | |
first = 0 | |
second = 1 | |
even = 0 | |
(1..num).each do |i| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'prime' | |
p 'enter number:' | |
num = gets.chomp.to_i | |
def prime(num) | |
pfactor = num.prime_division | |
puts "The largest prime factor of #{num} is #{pfactor.last[0]}." | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# libraries that must be installed before use | |
require 'rubygems' | |
require 'sinatra' | |
require 'mongo' | |
require 'json/ext' | |
require 'date' | |
# create mongo instance | |
include Mongo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source = $("#id_on_handlebars_script_tag").html() | |
template = Handlebars.compile source | |
$.getJSON('some route to json markup', (data)-> | |
$("#content_placeholder").html(template data) | |
).error -> | |
console.log "error" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'%03d' % 1 # 001 |
OlderNewer