Skip to content

Instantly share code, notes, and snippets.

@tony19
tony19 / gh-archive-repo.sh
Created February 19, 2022 18:04
Script to make GitHub repo private and archived
#!/bin/sh -e
if [ $# -eq 0 ]; then
echo "usage: $0 <repo> [<repo> ...]"
exit 1
fi
repos=$@
makePrivateAndArchiveRepo () {
@tony19
tony19 / vue.config.js
Created February 1, 2019 22:56
Configure Vue CLI project to emit full stack of errors
module.exports = {
chainWebpack: config => {
config.plugin('friendly-errors')
.tap(args => {
args[0].onErrors = (severity, errors) => {
// if (severity !== 'error') {
// return;
// }
for (const error of errors) {
console.error(error.webpackError)
@tony19
tony19 / vue-inspect-output.webpack.js
Last active December 2, 2018 10:44
Output of `vue inspect` (https://stackoverflow.com/q/53431754/6277151) -- Vue CLI v3.2.1
{
mode: 'development',
context: '/Users/tony/src/tmp/snirp-vue-web-component',
devtool: 'cheap-module-eval-source-map',
node: {
setImmediate: false,
process: 'mock',
dgram: 'empty',
fs: 'empty',
net: 'empty',
@tony19
tony19 / serve.js
Created February 25, 2018 17:06
Running polyserve with URL-rewrite middleware
const {startServer} = require('polyserve');
const projectConfig = require('./polymer.json');
const serverOptions = {
compile: projectConfig.compile,
entryPoint: projectConfig.entryPoint,
port: 8080,
root: 'src',
};
@tony19
tony19 / get_entries.py
Last active May 28, 2016 02:21
Python Flask app that shows merging URL 'entry' parameters into array
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/api/test')
def test():
return jsonify(entries=request.args.getlist('entry'))
if __name__ == '__main__':
app.run()
@tony19
tony19 / prefix_git_log.sh
Created April 11, 2016 02:25
prefix text to git history
# /usr/bin/env bash -e
# This uses git-filter-branch to prepend a given string to each commit summary.
prefix=:smiley:
ref1=HEAD~2
ref2=HEAD
git filter-branch -f --msg-filter 'stdin=$(cat) && echo "$prefix $stdin"' $ref1..$ref2
@tony19
tony19 / config.json
Last active February 11, 2016 21:47
My Atom settings
"*":
"atom-css-comb":
commonConfigs: "/Users/tony/.csscomb.json"
readyMadeConfigs: "csscomb"
"atom-csscomb":
configureWithJSON: true
"atom-ctags": {}
"color-picker":
randomColor: false
core:
@tony19
tony19 / designer.html
Created April 22, 2015 01:34
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>
@tony19
tony19 / copyright.sh
Created April 20, 2014 02:04
Inserts copyright text into files if needed
@tony19
tony19 / newest_git_ubuntu.sh
Created April 8, 2012 19:28
Install newest git on Ubuntu 11.10
#!/bin/sh
# Ubuntu 11.10 currently comes with Git 1.7.2. If you want to install
# the latest dev build of Git, follow these steps. One feature I really
# needed from this is the ability to stash unstaged *and untracked*
# changes. (Current version only stashes unstaged changes)
sudo apt-get install libssl-dev libcurl4-gnutls-dev libexpat1-dev
git clone git://git.kernel.org/pub/scm/git/git.git
git tag