Skip to content

Instantly share code, notes, and snippets.

def alert(variable)
@variable = variable
end
def someothermailermethod(variable1, variable2, variable3)
@variable1, @variable2, @variable3 = variable1, variable2, variable3
end
<script type="text/javascript">
var pusher = new Pusher('f600b50f55a687b255c6');
var channel = pusher.subscribe('local_app_cache');
channel.bind('events_for_group_id_12345', function(data) {
sessionStorage.clear()
});
</script>
@n8
n8 / gist:4677975
Last active December 11, 2015 23:38
Stuff
This should be more like this
and this

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discussions around concrete examples, not handy-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

es:
errors:
messages:
expired: "ha expirado, por favor pide una nueva"
not_found: "no encontrado"
already_confirmed: "ya fue confirmada. Intenta ingresar."
not_locked: "no ha sido bloqueada"
not_saved:
one: "Ha habido 1 error:"
other: "Han habido %{count} errores:"
/* ++++++++++++++++++ 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;
var snapbackCache = SnapbackCache({
bodySelector: "#recordings"
});
jQuery(document).on("click", "body#recordings a", function (e) {
snapbackCache.cachePage();
});
@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
@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
});
require 'zlib'
module FeatureFlags
BETA_ACCOUNTS = %w(subdomain1 subdomain2)
FLAGS = {
:new_import_flow => {
:percentage => 10,
:account_subdomains => []
},