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
// animate scroll put this on (PAGE B) | |
var elementClick = window.location.hash | |
var destination = $(elementClick).offset().top; | |
$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100, function() { | |
window.location.hash = elementClick | |
}); |
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
<!-- before --> | |
<script src="https://gist.github.com/username/gist_id.js"></script> | |
<script src="https://gist.github.com/username/gist_id.js?file=file_name"></script> | |
<!-- after --> | |
<div class="gist" data-src="https://gist.github.com/username/gist_id.json"></div> | |
<div class="gist" data-src="https://gist.github.com/username/gist_id.json" data-file="file_name"></div> |
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
# add paperclip | |
gem 'paperclip', '~>3.4.2' | |
# add vestal versions | |
gem 'vestal_versions', :git => 'git://github.com/laserlemon/vestal_versions' |
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
# Modems configuration | |
# | |
# Example and default values | |
# | |
# group = modems | |
# id = "my-id" | |
# name = "my-name" | |
# detect-string = "MODEM" | |
# detect-string2 = "" [Default] | |
# init-string = "AT+CNMI=1,2,0,0,0" [Default] |
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
gem 'faker', github: 'stympy/faker' | |
gem 'rack-contrib' | |
gem 'soulmate', :require => 'soulmate/server' |
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
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h3 class="panel-title"><%= task.title %></h3> | |
</div> | |
<div class="panel-body"> | |
<%= truncate task.description, length: 50 %> | |
</div> | |
</div> |
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
gem 'bootstrap-sass' | |
gem 'devise' | |
gem 'mailboxer' |
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
def find_longest_common_substring(s1, s2) | |
if (s1 == "" || s2 == "") | |
return "" | |
end | |
m = Array.new(s1.length){ [0] * s2.length } | |
longest_length, longest_end_pos = 0,0 | |
(0 .. s1.length - 1).each do |x| | |
(0 .. s2.length - 1).each do |y| | |
if s1[x] == s2[y] | |
m[x][y] = 1 |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
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
// turbolinks addthis | |
var initAdthis; | |
initAdthis = function(){ | |
// Remove all global properties set by addthis, otherwise it won't reinitialize | |
for (var i in window) { | |
if (/^addthis/.test(i) || /^_at/.test(i)) { | |
delete window[i]; | |
} | |
} |
OlderNewer