title | tags | authors | |||||
---|---|---|---|---|---|---|---|
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily |
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Vector { | |
constructor(public x: number, public y: number, public z: number) { } | |
static times(k: number, v: Vector) { | |
return new Vector(k * v.x, k * v.y, k * v.z); | |
} | |
static minus(v1: Vector, v2: Vector) { | |
return new Vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const emojis = [ | |
0x1f201, | |
0x1f202, | |
0x1f21a, | |
0x1f22f, | |
0x1f232, | |
0x1f233, | |
0x1f234, | |
0x1f235, | |
0x1f236, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
function main() { | |
const mods = Object.keys(require("./package.json").dependencies); | |
mods | |
.forEach(mod => { | |
const {license: a, LICENSE: b, main} = require(`./node_modules/${mod}/package.json`); |
-
getAllLinks.js
-
getAllLinks(element) - returns array of all UrlLinks in Document
-
findAndReplaceLinks(searchPattern,replacement) - changes all matching links in Document
-
changeCase.js - Document add-in, provides case-change operations in the add-in Menu.
-
onOpen - installs "Change Case" menu
-
_changeCase - worker function to locate selected text and change text case. Case conversion is managed via callback to a function that accepts a string as a parameter and returns the converted string.
-
helper functions for five cases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
ssl_certificates: | |
- certificate_src: secure.example.com.pem | |
certificate_dest: /etc/ssl/certs/secure.example.com.pem | |
key_src: secure.example.com.protected.key | |
key_dest: /etc/ssl/private/secure.example.com.protected.key | |
key_stripped: /etc/ssl/private/secure_example.com.key | |
key_password: "{{ssl_passphrase}}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/25059997/universal-analytics-client-id | |
function generateClientIdSelf() { | |
return Math.floor(Math.random() * 0x7FFFFFFF) + "." + Math.floor(Date.now() / 1000); | |
} | |
// https://www.google-analytics.com/analytics.js | |
function generateClientIdGA() { | |
function hd() { | |
return math.round(2147483647 * math.random()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.contrib.auth.decorators import login_required | |
from django.http import Http404 | |
from django.http import JsonResponse, HttpResponseRedirect, HttpResponsePermanentRedirect | |
from django.http import HttpResponseBadRequest, HttpResponseForbidden | |
from django.views.generic import TemplateView | |
from django.utils.decorators import method_decorator | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import local | |
class Bucket(object): | |
def __init__(self, bucket, s3=None): | |
if s3 is None: | |
s3 = s3_storage | |
self.bucket = bucket | |
self.s3 = s3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream tornadoFrontends { | |
server 127.0.0.1:8000; | |
server 127.0.0.1:8001; | |
server 127.0.0.1:8002; | |
server 127.0.0.1:8003; | |
} | |
server { | |
listen 80; | |