Skip to content

Instantly share code, notes, and snippets.

View ralphsmith80's full-sized avatar

Ralph ralphsmith80

View GitHub Profile
@ralphsmith80
ralphsmith80 / py-sys-exit-override.py
Last active August 9, 2017 17:33
Get code after sys.exit()
import sys
def something():
print("Kenny lives")
sys.exit()
print("Can you see me")
if __name__ == '__main__':
# only code here
def noop():
@ralphsmith80
ralphsmith80 / off-canvas-transistion
Last active August 29, 2015 14:05
Off Canvas Transition - Progressive Enhancement
<head>
<!-- Viewport meta tag to prevent iPhone from scaling our page -->
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1.0; user-scalable=yes;"/>
<style>
body {
margin: 0;
background-color: linen;
}
.main {
width: 100%;
@ralphsmith80
ralphsmith80 / requirejs_dependency_fail.md
Last active December 19, 2015 21:48
Requirejs dependencies undefined

requirejs-config.json


    require.config({
 "baseUrl": "/static",
 "paths": {
  "api": "components/api",
  "auxl": "components/auxl",
  "bedrock": "components/bedrock",
@ralphsmith80
ralphsmith80 / gist:5034245
Created February 25, 2013 23:16
View extend for templates
View.extend = _.wrap(View.extend, function(func) {
var rest = Array.prototype.slice.call(arguments, 1),
derivedClass = func.apply(this, rest);
derivedClass.prototype.defaults = $.extend(true, {},
derivedClass.__super__.prototype.defaults,
derivedClass.prototype.defaults);
derivedClass.prototype.templates = $.extend(true, {},
derivedClass.__super__.prototype.templates,
derivedClass.prototype.templates);
@ralphsmith80
ralphsmith80 / simpleview_updates.md
Last active December 13, 2015 17:29
Model events as relationships

This is my first take on providing functionality for modeling events as relationships within our views.

listenTo: function(subject, evt, observerCallback) {
  var relationshipIndex = this.get('relationshipIndex') || [],
      relationship = {
        subject: subject,
        evt: evt,
        observerCallback: observerCallback
 };
daft:
send_report:
errors:
pattern: The send to field must contain only a list of valid email addresses
field_errors:
name:
min_length: Name must contain at least 1 non-whitespace character
notify:
min_length: At least one email address must be entered