Handy notes from this article.
git submodule add https://github.com/caarlos0/shell-travis-build.git build
cp build/travis.yml.example .travis.yml
Adds ShellCheck verification via Travis CI for any shell scripts in the repo.
<?php | |
/** | |
* Plugin Name: Redirect Old URLs | |
* Description: Supports redirecting from an old site's URL to a new site on same domain. | |
* Version: 0.1.0 | |
* Author: The WPLib Team | |
* Author URI: http://github.com/wplib | |
* Author Email: team@wplib.org | |
* License: GPL2 | |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
/*jslint node: true */ | |
'use strict'; | |
module.exports = function (grunt) { | |
/* | |
1. make package.json.js and export the json that will be saved as package.json | |
2. run grunt package.json, the new file will be written and you get a patch as well | |
*/ | |
grunt.registerTask('package.json', function () { |
{"bulbasaur":{"base_stats":{"hp":45,"atk":49,"def":49,"spa":65,"spd":65,"spe":45},"name":{"en":"Bulbasaur","ja":"フシギダネ"},"type":["Grass","Poison"],"moves":{"tackle":{"type":"Normal","power":"50","accuracy":"100","category":"Physical","pp":35,"method":["level_up"]},"growl":{"type":"Normal","power":"0","accuracy":"100","category":"Status","pp":40,"method":["level_up"]},"leechseed":{"type":"Grass","power":"0","accuracy":"90","category":"Status","pp":10,"method":["level_up"]},"vinewhip":{"type":"Grass","power":"45","accuracy":"100","category":"Physical","pp":25,"method":["level_up"]},"poisonpowder":{"type":"Poison","power":"0","accuracy":"75","category":"Status","pp":35,"method":["level_up"]},"sleeppowder":{"type":"Grass","power":"0","accuracy":"75","category":"Status","pp":15,"method":["level_up"]},"takedown":{"type":"Normal","power":"90","accuracy":"85","category":"Physical","pp":20,"method":["level_up"]},"razorleaf":{"type":"Grass","power":"55","accuracy":"95","category":"Physical","pp":25,"method":["level_up" |
{ | |
"bulbasaur": { | |
"base_stats": { | |
"hp": 45, | |
"atk": 49, | |
"def": 49, | |
"spa": 65, | |
"spd": 65, | |
"spe": 45 | |
}, |
--- | |
language: ruby | |
rvm: | |
- 2.0.0 | |
bundler_args: --without development --path=~/.bundle | |
env: | |
global: | |
- BUNDLE_ARCHIVE="app-bundle-archive" | |
- RAILS_ENV=test | |
- secure: "A_VERY_LONG_SERIES_OF_CHARACTERS_HERE" |
Handy notes from this article.
git submodule add https://github.com/caarlos0/shell-travis-build.git build
cp build/travis.yml.example .travis.yml
Adds ShellCheck verification via Travis CI for any shell scripts in the repo.
Tricks to add encrypted private SSH key to .travis.yml file | |
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21 | |
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64 | |
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)" | |
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_ | |
// Implement bash string escaping. | |
var safePattern = /^[a-z0-9_\/\-.,?:@#%^+=\[\]]*$/i; | |
var safeishPattern = /^[a-z0-9_\/\-.,?:@#%^+=\[\]{}|&()<>; *']*$/i; | |
function bashEscape(arg) { | |
// These don't need quoting | |
if (safePattern.test(arg)) return arg; | |
// These are fine wrapped in double quotes using weak escaping. | |
if (safeishPattern.test(arg)) return '"' + arg + '"'; |
#!/usr/bin/env php | |
<?php | |
///////////////////// | |
// slack2html | |
// by @levelsio | |
///////////////////// | |
// | |
///////////////////// | |
// WHAT DOES THIS DO? | |
///////////////////// |
package main | |
import ( | |
"errors" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net" | |
"os" | |
"os/exec" |