$ django-admin startproject moneymakingsite
$ python manage.py startapp merchandise
| def _get_attr_value(instance, attr, default=None): | |
| """ | |
| Simple helper to get the value of an instance's attribute if it exists. | |
| If the instance attribute is callable it will be called and the result will | |
| be returned. | |
| Optionally accepts a default value to return if the attribute is missing. | |
| Defaults to `None` |
| Here is a list of scopes to use in Sublime Text 2 snippets - | |
| ActionScript: source.actionscript.2 | |
| AppleScript: source.applescript | |
| ASP: source.asp | |
| Batch FIle: source.dosbatch | |
| C#: source.cs | |
| C++: source.c++ | |
| Clojure: source.clojure | |
| CoffeeScript: source.coffee |
| const readSession = function(portHandle, sectors) { | |
| // this holds the result | |
| let result = []; | |
| // this is the entry point of the recursive func | |
| let _readAll = function(sectorsToRead) { | |
| // when there's no more sectore to read | |
| // we stop and return the result | |
| if (sectorsToRead.length === 0) { | |
| return result; | |
| } |
| + // Write on keyup event of keyword input element | |
| + $("#search").keyup(function(){ | |
| + _this = this; | |
| + // Show only matching TR, hide rest of them | |
| + $.each($("#teamTable tbody tr"), function() { | |
| + if($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1) | |
| + $(this).hide(); | |
| + else | |
| + $(this).show(); | |
| + }); |
| #!/usr/bin/expect | |
| # argv 0 is password | |
| # argv 1 is command e.g. kextload -b info.stichling.USBCDCACMControl | |
| # get the password from the commandline | |
| set password [lindex $argv 0] | |
| # get the command from the commandline | |
| set command "sudo [lindex $argv 1]" |