The following commands are organized by their CRUD functionality. This was designed to be a quick 'n easy cheat sheet.
Database: savetheworld
Table: superheros
id | superhero | password | age | |
---|---|---|---|---|
1 | batman | badpassword | batman@superhero.com | 40 |
python -m SimpleHTTPServer |
var http = require('http'); | |
http.createServer(function (request, response) { | |
response.writeHead(200, {'Content-Type': 'text/html'}); | |
response.end('<html><body>' + request.url + '</body></html>'); | |
console.log(request.url); | |
}).listen(3000, 'localhost'); |
<div class="loader"> | |
<div class="dot dot1"></div> | |
<div class="dot dot2"></div> | |
<div class="dot dot3"></div> | |
<div class="dot dot4"></div> | |
</div> |
var testObject = { 'one': 1, 'two': 2, 'three': 3 }; | |
// Put the object into storage | |
localStorage.setItem('testObject', JSON.stringify(testObject)); | |
console.log(JSON.stringify(testObject)); | |
// Retrieve the object from storage | |
var retrievedObject = localStorage.getItem('testObject'); |
svn ls http://example.com/svn/example/tags/qa | cut -d "/" -f 1 | sort -t . -k 1,2n -k 2,2n -k 3,2 | tail –n1 |
The following commands are organized by their CRUD functionality. This was designed to be a quick 'n easy cheat sheet.
Database: savetheworld
Table: superheros
id | superhero | password | age | |
---|---|---|---|---|
1 | batman | badpassword | batman@superhero.com | 40 |
{ | |
"caret_style": "smooth", | |
"close_windows_when_empty": true, | |
"create_window_at_startup": false, | |
"font_size": 14, | |
"highlight_line": true, | |
"hot_exit": false, | |
"ignored_packages": | |
[ | |
"Vintage" |
##How to use a jQuery Plugin with RequireJS
I'm using several jQuery Plugins for a Node app I'm building. One plugin in particular which I'll use for illustration purposes is jQuery Cookie. jQuery Cookie depends on jQuery, therefore I needed an ascyhonous dependency management solution.
After searching throug RequireJS documentation and trial and error, I was able to put together the following working code to serve as a shim. This code resides in a a file called common.js
and sits at the root of my /javascripts
directory (where all of my other RequireJS modules camp out as well.) In this file I define two resources. In this case I'm pointing to CDN versions of jQuery and jQuery Cookie (this actually further exaserbates the need for a dependency management system as I'm not loading these resources from my own server and can't control latency and network delays.)
common.js
require.config({
paths: {
This is how to resolve the following command line error message when pushing your app to Heroku:
~/Desktop/appname git push heroku master
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.
fatal: 'heroku' does not appear to be a git repository
Please make sure you have the correct access rights and the repository exists.
The above error message appears because there's no remote named heroku. When you do a heroku create, if the git remote doesn't already exist, Heroku automatically creates one assuming you're in a git repo.