Skip to content

Instantly share code, notes, and snippets.

View gist:438410
def alert(variable)
@variable = variable
end
def someothermailermethod(variable1, variable2, variable3)
@variable1, @variable2, @variable3 = variable1, variable2, variable3
end
View gist:2559072
<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>
View gist:4677975
This should be more like this
and this
View adams-heroku-values.md

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

View devise.es.yml
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:"
View gist:64748ac46ee67051dc45
/* ++++++++++++++++++ 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;
View gist:96475a20b36e87973671
var snapbackCache = SnapbackCache({
bodySelector: "#recordings"
});
jQuery(document).on("click", "body#recordings a", function (e) {
snapbackCache.cachePage();
});
View .js
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
View .js
jQuery("#recordings").on("snapback-cache:loaded", function(e, cachedPage) {
// sets the pager to page from the appropriate place
EndlessPage.offset = cachedPage.nextPageOffset
});
View gist:509f000552291c1943fe5d87018bae81
require 'zlib'
module FeatureFlags
BETA_ACCOUNTS = %w(subdomain1 subdomain2)
FLAGS = {
:new_import_flow => {
:percentage => 10,
:account_subdomains => []
},