Skip to content

Instantly share code, notes, and snippets.

@MichaelJCole
MichaelJCole / scale.sh
Created January 7, 2016 16:46
Script to scale PDF's
#!/bin/bash
# pdfScale.sh
#
# Scale PDF to specified percentage of original size.
# Ref: http://ma.juii.net/blog/scale-page-content-of-pdf-files.
SCALE=0.95 # scaling factor (0.95 = 95%, e.g.)
# Validate args.
@MichaelJCole
MichaelJCole / spec.json
Last active August 29, 2015 14:27
spec.json
{
"swagger": "2.0",
"info": {
"title": "test API",
"description": "test Swagger 2.0 API specification. This API spec can be used for integrating your Form.io project into non-HTML5 programs like \"native\" phone apps, \"legacy\" and \"enterprise\" systems, embedded \"Internet of Things\" applications (IoT), and other programming languages. Note: The URL's below are configured for your specific project and form.",
"termsOfService": "http://form.io/terms/",
"contact": {
"name": "Form.io Support",
"url": "http://help.form.io/",
"email": "support@form.io"
@MichaelJCole
MichaelJCole / gist:aa4895dc6cf260c9445f
Created May 30, 2015 19:14
New /platforms/browser/cordova/run
#!/usr/bin/env node
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@MichaelJCole
MichaelJCole / nginx.conf.template
Last active April 21, 2021 16:28
Dokku CORS SSL nginx template
## This is/was the template from /root/dokku/plugins/nginx-vhosts/templates/nginx.ssl.conf
## See the CORS section added below
server {
listen [::]:80;
listen 80;
server_name $NOSSL_SERVER_NAME;
return 301 https://$SSL_SERVER_NAME\$request_uri;
}
server {
#!/bin/bash
# pdfScale.sh
#
# Scale PDF to specified percentage of original size.
# Ref: http://ma.juii.net/blog/scale-page-content-of-pdf-files.
echo "This script doesn't handle files with spaces in them."
SCALE=0.95 # scaling factor (0.95 = 95%, e.g.)
@MichaelJCole
MichaelJCole / git push production master
Created May 11, 2014 21:15
MEAN.JS Heroku Deployment: git push production master
☀ git push production master master
Initializing repository, done.
Counting objects: 2797, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (1390/1390), done.
Writing objects: 100% (2797/2797), 1.43 MiB | 161.00 KiB/s, done.
Total 2797 (delta 1313), reused 2793 (delta 1311)
-----> Deleting 1 files matching .slugignore patterns.
-----> Node.js app detected
@MichaelJCole
MichaelJCole / heroku.sh
Last active August 29, 2015 14:01
MEAN.JS setup summary
#!/bin/bash
## Setup your MEAN.JS and Heroku dev/stage/prod environment
# http://blog.powma.com/fast-cheap-and-mean-devstageprod-server-setup-with-heroku/
# Config for your project:
YOURAPPNAME=YOUR_APP_NAME
## Create Production server