Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| function exceptionalException(message) { | |
| 'use strict'; | |
| if (exceptionalException.emailErrors !== false) { | |
| exceptionalException.emailErrors = confirm('We had an error reporting an error! Please email us so we can fix it?'); | |
| } | |
| } | |
| //test | |
| //exceptionalException('try 1!'); | |
| //exceptionalException('try 2!'); |
| //Superseeded: https://gist.github.com/devinrhode2/4705947 | |
| /** | |
| * Keep a histroy array of console log's | |
| * See example at bottom | |
| */ | |
| window.originalConsole = window.console; | |
| window.originalLog = window.console.log; | |
| window.logWithHistory = function logWithHistoryFn() { |
| // How to define: | |
| // -------------- | |
| var callableObjectFn = function() { | |
| // Use CallableObject as name in constructor function, but also when setting property below. | |
| var CallableObject = (function(CallableObject) { | |
| return function() { | |
| return CallableObject(); | |
| }; | |
| }(callableObjectFn)); | |
| CallableObject.property = 'value'; |
| #!/usr/bin/env python | |
| # -*- coding: UTF-8 -*- | |
| #------------------------------------------------------------------------------- | |
| # Name: maskedit.py | |
| # Purpose: | |
| # | |
| # Author: Maxwell Morais (max.morais.dmm@gmail.com) | |
| # | |
| # Created: 10/04/2013 |
| from webclient import * | |
| server = "http://myaccount.erpnext.com/server.py" | |
| user = "your user name" | |
| password = "your password" | |
| login() | |
| customer = get_doc("Customer", customer_name) |
| # coding: utf-8 | |
| from weasyprint import HTML, CSS | |
| def get_page_body(boxes): | |
| for box in boxes: | |
| if box.element_tag == 'body': | |
| return box |
| ''' expressionString = IF Variable_3 > 1000 RETURN VARIABLE_3* VARIABLE_1 END IF Variable_3 < 1000 RETURN VARIABLE_3* VARIABLE_2 END ''' | |
| def parse_expression(expressionString): | |
| expressionStringArray = filter(None,expressionString.split("END")) | |
| ''' expressionStringArray[0] = IF Variable_3 > 1000 RETURN VARIABLE_3* VARIABLE_1 | |
| expressionStringArray[1] = IF Variable_3 < 1000 RETURN VARIABLE_3* VARIABLE_2 ''' | |
| for expression in expressionStringArray: | |
| expConditionResult = expression.strip().split("RETURN") |
This Gist has been moved to https://github.com/lbgists/ttk-progressbar-example.py.
| SalesOrder.prototype.decorate = function(decorator) { | |
| var override | |
| for (override in decorator) { | |
| if (decorator.hasOwnProperty(override)) { | |
| var oldfunc = this[override] | |
| var decfunc = decorator[override] | |
| var newfunc = function() { | |
| var args = Array.prototype.slice.call(arguments) |