Skip to content

Instantly share code, notes, and snippets.

View jaywon's full-sized avatar

Jason Sewell jaywon

View GitHub Profile
@jaywon
jaywon / install-comodo-ssl-cert-for-nginx.rst
Created October 19, 2015 02:22 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@jaywon
jaywon / z_collection-hooks-stub.js
Created November 7, 2015 23:25
A mock for the Meteor smart package collection-hooks. Add this file in the folder tests/jasmine/server/unit/
var originalMeteorCollection = Meteor.Collection;
Meteor.Collection = function () {
var collectionHooks = {
before: {
insert: [],
update: [],
remove: []
},
after: {
@jaywon
jaywon / functions.md
Last active November 27, 2023 04:15 — forked from sgnl/functions.md
Functions

Functions

Functions are great, they take data (input), do stuff with that data and then return it to you all shiny and fancy (output).

Below are some specifications for Functions to be built.

Declare Two Variables

  • a random Number value
  • b random Number value

We will be using both of these variables to pass as parameters to the following functions that we will write. Pay close attention to the other variable names you will create as they will become input to other functions.

@jaywon
jaywon / forLoops.md
Last active January 12, 2016 20:56 — forked from sgnl/forLoops.md
What For... loops.

Getting Loopy

For loops are great for:

  1. Iterating through an Array to access values within

  2. or running a set of instructions over and over again for a set amount of times, executing functions or one-off code.

  3. or any/all combinations of the above.

Exercises

@jaywon
jaywon / gist:8c6823bb12c962d9485d
Created February 13, 2016 22:12 — forked from anonymous/gist:e8dadc89a18a61e7f6ee
Fix Ubuntu internal speaker audio
1. Edit `/etc/modprobe.d/alsa-base.conf`
2. Add this line to end: `/etc/modprobe.d/alsa-base.conf`
@jaywon
jaywon / README.md
Created February 14, 2016 21:46 — forked from hbpasti/README.md
fontawesome with i3status

fontawesome with i3status

This is my i3 config, using FontAwesome icons for i3status.

Save files to ~/.i3.

@jaywon
jaywon / five_minutes.yml
Created March 9, 2016 06:36 — forked from ryane/five_minutes.yml
five_minutes.yml
---
- hosts: all
vars:
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx'
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx'
UBUNTU_COMMON_LOGWATCH_EMAIL: user@example.com
ubuntu_common_deploy_user_name: deploy
ubuntu_common_deploy_public_keys:
- ~/.ssh/id_rsa.pub
@jaywon
jaywon / processingAudioDemo.java
Created March 16, 2016 10:38 — forked from anonymous/processingAudioDemo.java
Processing demo visualizing audio input data
import processing.sound.*;
// Declare the processing sound variables
SoundFile sample;
Amplitude rms;
// Declare a scaling factor
float scale = 5.0;
// Declare a smooth factor
@jaywon
jaywon / s3_multipart_upload.py
Created June 27, 2016 08:32 — forked from chrishamant/s3_multipart_upload.py
Example of Parallelized Multipart upload using boto
#!/usr/bin/env python
"""Split large file into multiple pieces for upload to S3.
S3 only supports 5Gb files for uploading directly, so for larger CloudBioLinux
box images we need to use boto's multipart file support.
This parallelizes the task over available cores using multiprocessing.
Usage:
s3_multipart_upload.py <file_to_transfer> <bucket_name> [<s3_key_name>]