_config.yml
Jekyll 的全局配置文件。
比如网站的名字,网站的域名,网站的链接格式等等。
| // Ref: https://medium.com/@RupaniChirag/writing-unit-tests-in-typescript-d4719b8a0a40 | |
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "node", | |
| "request": "launch", | |
| "name": "Mocha Current File", | |
| "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", | |
| "args": [ |
| # Mina Deploy | |
| # =========== | |
| # | |
| # Adapted from Creative deploy stack in Manabalss v4, Mar.2015, updated to support staging on Jun.2015 | |
| # On first deploy do: mina setup --verbose | |
| # Then do : mina deploy[initialize] --trace | |
| # | |
| # Usage examples: | |
| # mina deploy[soft,seed,compile] to=staging # deploy task with all options | a simple `mina deploy` will deploy to production | |
| # mina rake[db:seed] # for multi-argument tasks # mina 'rake[payments:refund[arg1\,arg2]]' |
def sha256Hash(text: String) : String = java.security.MessageDigest.getInstance("SHA-256").digest(text.getBytes()).map(0xFF & ).map { "%02x".format() }.foldLeft(""){_ + _}
def sha256Hash(text: String) : String = String.format("%064x", new java.math.BigInteger(1, java.security.MessageDigest.getInstance("SHA-256").digest(text.getBytes("UTF-8"))))verify via:
scala> sha256Hash("Rusty is a cowboy!")This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)
Sister Document - Restore MySQL from Amazon S3 - read that next
this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc
| # use a shared lock and credits_remaining | |
| @lock = Mutex.new | |
| @credits_remaining = 40 | |
| @shopify_url = ENV["SHOPIFY_URL"] | |
| # Sends a request to Shopify, blocking until credits are available | |
| def self.request(method, path, params={}) | |
| params[:headers] = {"Content-Type" => "application/json"} | |
| # wait for a credit |
| # use a shared lock and credits_remaining | |
| @lock = Mutex.new | |
| @credits_remaining = 40 | |
| @shopify_url = ENV["SHOPIFY_URL"] | |
| # Sends a request to Shopify, blocking until credits are available | |
| def self.request(method, path, params={}) | |
| params[:headers] = {"Content-Type" => "application/json"} | |
| # wait for a credit |
find the target postgrsql version on the page https://yum.postgresql.org/repopackages.php
install the package in server.
sudo rpm -ivh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-ami201503-95-9.5-3.noarch.rpm
upgrade the library.
sudo yum install postgresql95
| # -*- coding: UTF-8 -*- | |
| import requests | |
| import json | |
| def generate_header(url): | |
| import hashlib | |
| hash_object = hashlib.sha1(url + 'conviva95a') | |
| return {'Authorization': 'Bearer ' + hash_object.hexdigest()} |
| alias dev-docker='docker run --name ubuntu_bash -v /target/projects:/root/projects --rm -i -t ubuntu:16.04 bash' |