In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
// Use an AMD package here to gain access to nested internal modules. | |
require.config({ | |
packages: [{ | |
name: "jquery", | |
location: "vendor/jquery/src", | |
main: "index.js" | |
}] | |
}); | |
// If we are using AMD, we don't care about core. |
define([ | |
// jquery core is always required | |
'jquery/core', | |
// jquery utilities | |
'jquery/ajax', | |
'jquery/data' | |
], function(jq, ajax, data) { |
var redis = require('then-redis'); | |
var db = redis.createClient('tcp://localhost:6379'); | |
var express = require('express'); | |
var app = express(); | |
app.get('/heartbeat.php', function(req, res){ // lol not php! | |
db.sadd('heartbeats', req.query); | |
res.send('KTHXBAI'); | |
}); |
'use strict'; | |
var expect = require('chai').expect; | |
var jsdom = require('jsdom'); | |
var jquery = require('jquery'); // option 2 | |
var TodoView = require('../hello-backbone/views/todo-view'); | |
describe('Backbone.View', function() { | |
var $, todoView; // option 1 |
[ | |
{ | |
"use_channel":true, | |
"allow_empty_post_data":true, | |
"app_id":"edaded98-5119-4c8a-afc1-de722da03562", | |
"url":"http://chromecast.redbull.tv/receiver.php", | |
"dial_enabled":true | |
}, | |
{ | |
"use_channel":true, |
; Taken from https://github.com/weavejester/crypto-equality/blob/master/src/crypto/equality.clj | |
(ns crypto.equality | |
"Securely test sequences of data for equality.") | |
(defn eq? | |
"Test whether two sequences of characters or bytes are equal in a way that | |
protects against timing attacks. Note that this does not prevent an attacker | |
from discovering the *length* of the data being compared." | |
[a b] |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
code delimiters: <% %> | |
# keynote | |
- your business logic will live longer than your interface | |
- stateless | |
- no "spaghetti state" | |
- application should be able to reflect any combination of data | |
- views should transparently reflect models | |
- backbone patterns | |
- custom model methods |
import time | |
import requests | |
import json | |
class DownloadStationAPI(): | |
def __init__(self, host=None, username=None, password=None): | |
self.name = 'DownloadStation' |