Skip to content

Instantly share code, notes, and snippets.

Ralph ralphsmith80

Block or report user

Report or block ralphsmith80

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ralphsmith80
ralphsmith80 / py-sys-exit-override.py
Last active Aug 9, 2017
Get code after sys.exit()
View py-sys-exit-override.py
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 Aug 29, 2015
Off Canvas Transition - Progressive Enhancement
View off-canvas-transistion
<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 Dec 19, 2015
Requirejs dependencies undefined
View requirejs_dependency_fail.md

requirejs-config.json


    require.config({
 "baseUrl": "/static",
 "paths": {
  "api": "components/api",
  "auxl": "components/auxl",
  "bedrock": "components/bedrock",
@ralphsmith80
ralphsmith80 / gist:5034245
Created Feb 25, 2013
View extend for templates
View gist:5034245
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 Dec 13, 2015
Model events as relationships
View simpleview_updates.md

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
      };
View string errors
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
You can’t perform that action at this time.