// jQuery
$(document).ready(function() {
// code
})
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| handler () { | |
| kill -s SIGINT $PID | |
| while kill -0 $PID &>/dev/null | |
| do | |
| wait $PID | |
| done | |
| } |
This was a very straightforward workaround I used in a project to get things done while the assemble team is working on some serious converter gulp-convert.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def nearby_spots_old(request, lat, lng, radius=5000, limit=50): | |
| """ | |
| WITHOUT use of any external library, using raw MySQL and Haversine Formula | |
| http://en.wikipedia.org/wiki/Haversine_formula | |
| """ | |
| radius = float(radius) / 1000.0 | |
| query = """SELECT id, (6367*acos(cos(radians(%2f)) | |
| *cos(radians(latitude))*cos(radians(longitude)-radians(%2f)) | |
| +sin(radians(%2f))*sin(radians(latitude)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DisableMigrations(object): | |
| def __contains__(self, item): | |
| return True | |
| def __getitem__(self, item): | |
| return "notmigrations" | |
| MIGRATION_MODULES = DisableMigrations() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import webapp2 | |
| import mimetypes | |
| import os | |
| import time | |
| from datetime import datetime | |
| import base64 | |
| _here = os.path.dirname(__file__) | |
| USERNAME = 'foo' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Toaster AI v2 | |
| // by Richard Caceres | |
| // 11/12/09 | |
| // | |
| // Safety Precautions that could be put in place | |
| // Overheating | |
| // Description: Precautions to prevent the toaster from being on too long. | |
| // Status: A solution is put in place where the toaster can only be on N seconds at a time. | |
| // There is also a cool down period. | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <!-- Web Components --> | |
| <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script> | |
| <link rel="import" href="bower_components/polymer/polymer.html"> | |
| <link rel="import" href="bower_components/iron-localstorage/iron-localstorage.html"> | |
| </head> | |
| <body unresolved> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Info: | |
| ===== | |
| These snippets help me remember how to use Polymer syntax. Many come from the Polycasts YouTube videos. | |
| Message me @qtrandev in the Polymer Slack or email [email protected] and I'll message you links I know. | |
| Getting started: | |
| ================ | |
| bower init | |
| bower install --save Polymer/polymer#^1.0.0 |