Create Deploy-Token (Access-Token) for particular private repo and use it in dependency as following:
{
"dependencies": {
"package-name": "git+https://<username>:<access_token>@github.com/username/repository#{branch|tag}"
}
}
import logging | |
from time import perf_counter | |
from contextlib import ContextDecorator | |
class exectimelog(ContextDecorator): | |
def __init__(self, msg='Elapsed time', logger=None): | |
self.msg = msg | |
self.logger = logger or logging.getLogger(__name__) |
/** | |
shake effect | |
use any of following classes on the element to shake | |
*/ | |
.shake { | |
-webkit-animation: shake 0.45s; | |
-moz-animation: shake 0.45s; | |
animation: shake 0.45s; | |
} | |
.shake-2 { |
<VirtualHost *:80> | |
ServerName www.example.com | |
ServerAlias example.com | |
ServerAdmin [email protected] | |
DocumentRoot /path/to/example-site/app/app/web/static | |
Alias /robots.txt /path/to/example-site/app/app/web/static/robots.txt | |
Alias /favicon.ico /path/to/example-site/app/app/web/static/favicon.ico |
class DictObject(dict): | |
"""Dict behaving like an object, with attribute-style access.""" | |
__strict_attr__ = True | |
__attr_default__ = None | |
def __getattr__(self, name): | |
try: | |
return self[name] | |
except KeyError: |
/** | |
* Basic template parser | |
*/ | |
var TemplateSnippet = function (template) { | |
'use strict'; | |
// var re = /<%([^%>]+)?%>/g; | |
// var re = /<%(.+?)%>/g; | |
var re = /\{\{(.+?)\}\}/g; | |
var snippet = 'var snippet=[];\n', cursor = 0, match; | |
var add = function (line, js) { |
/** | |
* Simple State-Observer in JavaScript | |
*/ | |
var PropState = function () { | |
var _self = this; | |
var _state = {}; | |
var _callbacks = {}; | |
if (arguments.length) { | |
for (var i in arguments) { | |
var obj = arguments[i]; |
/** | |
* URL State manipulation utility | |
* | |
* Usage Example: | |
* //urlState.strictMode = (function() { return !this; })(); | |
* var queryString = urlState.search(); | |
* queryString.name = 'sujeet'; | |
* urlState.pathname('/result-page').search(queryString).update(); | |
*/ | |
(function (win) { |
/** | |
* (?!_) can not start with seperator | |
* (?!.*?_$) can not start with seperator | |
* [a-z] first letter should be alphabet | |
* [a-z_]+ other slug string | |
* | |
* @see https://unix.stackexchange.com/questions/78481/regex-to-match-identifiers-without-double | |
*/ | |
var regex = /^(?!_)(?!.*?_$)[a-z][a-z_]+$/; |