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 | |
kill -9 <PID> |
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
# in ApplicationHelper.rb | |
def flash_class(level) | |
case level | |
when :notice then "alert alert-info" | |
when :success then "alert alert-success" | |
when :error then "alert alert-error" | |
when :alert then "alert alert-block" | |
else "alert #{level} | |
end | |
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
# Ignore bundler config. | |
/.bundle | |
# Ignore the default SQLite database. | |
/db/*.sqlite3 | |
/db/*.sqlite3-journal | |
# Ignore all logfiles and tempfiles. | |
/log/*.log | |
/tmp |
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
rvm --create --ruby-version 2.2.1@victor |
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
grant all privileges on mydb.* to myuser@'%' identified by 'mypasswd'; |
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
$bootstrap-sass-asset-helper: false !default; | |
// | |
// Variables | |
// -------------------------------------------------- | |
//== Colors | |
// | |
//## Gray and brand colors for use across Bootstrap. |
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
CSV.open("myfile.csv", "w") do |csv| | |
csv << BusinessService.column_names | |
BusinessService.all.each do |m| | |
csv << m.attributes.values | |
end | |
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
func deviceRemainingFreeSpaceInBytes() -> Int64? { | |
let documentDirectoryPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) | |
let systemAttributes = NSFileManager.defaultManager().attributesOfFileSystemForPath(documentDirectoryPath.last as String, error: nil) | |
let freeSize = (systemAttributes?[NSFileSystemFreeSize] as? NSNumber)?.longLongValue | |
return freeSize | |
} | |
if let bytes = deviceRemainingFreeSpaceInBytes() { | |
println("free space: \(bytes)") | |
} else { |
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 'csv' | |
file = "#{Rails.root}/data.csv" | |
schools = School.where(state_code: 'CO').order('name ASC') | |
CSV.open( file, 'w' ) do |writer| | |
schools.each do |s| | |
writer << [s.name, s.zipcode, s.id] | |
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
if (typeof(some_variable) != 'undefined' && some_variable != null) |
OlderNewer