Skip to content

Instantly share code, notes, and snippets.

@n8
n8 / 3.rb
Last active October 30, 2018 14:27
query = "category = '#{params[:category]}'"
projects = Project.where(query).limit(10)
@n8
n8 / 2.rb
Last active October 30, 2018 14:26
string = "Nate is #{ruby_variable}. And super smart."
@n8
n8 / 1.rb
Last active October 30, 2018 14:26
ruby_variable = "cool"
string = "Nate is #{ruby_variable}"
<body>
<div id='myAlert' style="background: #000; font-size: 2rem; color: #fff; padding: 2rem; display:none; line-height: 2.5rem">
<a href="#" style="float: right; color: #fff; text-decoration: none" onclick="hideAlert()">&times;</a>
We'll be offline at 9:00PM Central June 22 for database maintance. It should take 60 minutes at most.
</div>
@n8
n8 / 1.html
Last active June 27, 2018 18:02
<div id='myAlert' style="background: #000; font-size: 2rem; color: #fff; padding: 2rem; display:none; line-height: 2.5rem">
<a href="#" style="float: right; color: #fff; text-decoration: none" onclick="hideAlert()">&times;</a>
We'll be offline at 9:00PM Central June 22 for database maintance. It should take 60 minutes at most.
</div>
<script>
require 'zlib'
module FeatureFlags
BETA_ACCOUNTS = %w(subdomain1 subdomain2)
FLAGS = {
:new_import_flow => {
:percentage => 10,
:account_subdomains => []
},
@n8
n8 / .js
Created March 17, 2016 16:38
jQuery("#recordings").on("snapback-cache:loaded", function(e, cachedPage) {
// sets the pager to page from the appropriate place
EndlessPage.offset = cachedPage.nextPageOffset
});
@n8
n8 / .js
Created March 17, 2016 16:37
var snapbackCache = SnapbackCache({
bodySelector: "mandatory selector of your infinite feed",
finish: function () {
optional method of something that needs to finish on your page before caching the page
},
removeAutofocus: function () {
optional method to kill autofocusing which screws with scrolling the page
},
refreshItems: function (dirtyThings) {
optional method to fetch fresh bits from your server you want to replace in the cache
var snapbackCache = SnapbackCache({
bodySelector: "#recordings"
});
jQuery(document).on("click", "body#recordings a", function (e) {
snapbackCache.cachePage();
});
/* ++++++++++++++++++ Highrise (http://highrisehq.com) ------------------------------------------------------ */
/* ------------------ Main App Styles ----------------------------------------------------------------------- */
@font-face {
font-family: 'Highrise Open Sans';
font-style: normal;
font-weight: 400;
src: url("//static.highrisehq.com/web/fonts/opensans-regular.eot?#iefix") format("embedded-opentype"), url("//static.highrisehq.com/web/fonts/opensans-regular.woff2") format("woff2"), url("//static.highrisehq.com/web/fonts/opensans-regular.woff") format("woff"), url("//static.highrisehq.com/web/fonts/opensans-regular.ttf") format("truetype"); }
@font-face {
font-family: 'Highrise Open Sans';
font-style: normal;