Skip to content

Instantly share code, notes, and snippets.

View kevincharm's full-sized avatar

kevincharm

View GitHub Profile
@kevincharm
kevincharm / meteor-plz.sh
Last active August 29, 2015 14:13
Bash script for deploying Meteor (1.0.3.1) app to CentOS 6 running forever (now using pm2)
#!/bin/bash
# https://gist.github.com/hellstad
# This is a script I use to automate deploying my meteor app from my git repository to my server running:
# CentOS 6 x86_64
# nginx 1.4.7
# node 0.10.33
# forever 0.13.0
# npm 1.4.28
@kevincharm
kevincharm / centos-ami.md
Last active March 20, 2018 16:45
AWS CentOS 7 AMI => Setup for root login via SSH

AWS CentOS 7 AMI Setup for mplz

  1. SSH to EC2 then exec sudo visudo then add line centos ALL=(ALL) NOPASSWD:ALL
  2. exec sudo su - root
  3. exec sudo vi /etc/ssh/sshd_config then edit/uncomment line
@kevincharm
kevincharm / letsencrypt-autogen.sh
Last active January 22, 2020 19:40
CentOS 7 Let's Encrypt SSL certs
#!/bin/bash
# Automates letsencrypt SSL cert generation/installation on CentOS 7 w/nginx
# MIT, use at your own risk blabla
EMAIL=foo@bar.com
DOMAIN_NAME=foo.bar.com
sudo su - root
cd ~
git clone https://github.com/letsencrypt/letsencrypt
@kevincharm
kevincharm / _superstate.js
Last active January 20, 2016 05:30
Accessing/passing down parent state (ReactiveDict) in Blaze
/**
* Global helper for applying parent state to current template.
* Usage:
* Invoke superstate(this); in a Template.onCreated callback to inherit parent state.
* @param templateInstance {Object} The current Blaze.View object to pass in.
* @returns {Object} The state object.
*/
superstate = (templateInstance, stateProp) => {
// defaults to Template.instance().state
if (!stateProp) stateProp = 'state';

Keybase proof

I hereby claim:

  • I am hellstad on github.
  • I am kevincharm (https://keybase.io/kevincharm) on keybase.
  • I have a public key ASABXcIa-0dHMdXEp7DcmVmYhgOipLUfPWrEhKIegl_SFAo

To claim this, I am signing this object:

@kevincharm
kevincharm / bitarray.service.js
Last active November 29, 2017 06:10
bitarray.service.js
/**
* bitarray.js
*
* Utility for working with JS TypedArrays at bit level. (Angular Service)
*
* @author kevincharm
* @license MIT
*/
angular
@kevincharm
kevincharm / cassandra.service
Created October 22, 2016 16:54 — forked from s0undt3ch/cassandra.service
CentOS 7 Cassandra systemd service file
# /usr/lib/systemd/system/cassandra.service
[Unit]
Description=Cassandra
After=network.target
[Service]
PIDFile=/var/run/cassandra/cassandra.pid
User=cassandra
Group=cassandra
@kevincharm
kevincharm / git_merge_ours.js
Created January 30, 2017 07:31
Node script that automates git checkout --ours or --theirs for all files in a merge conflict
#!/usr/bin/env node
'use strict'
const childProcess = require('child_process')
function bash() {
return new Promise((resolve, reject) => {
const terminal = childProcess.spawn('bash')
resolve(terminal)
})
@kevincharm
kevincharm / keybase.md
Created September 7, 2017 07:41
keybasev2

Keybase proof

I hereby claim:

  • I am kevincharm on github.
  • I am kevincharm (https://keybase.io/kevincharm) on keybase.
  • I have a public key whose fingerprint is BCF1 8249 4254 7EFE EC77 D14C 1843 EB66 5597 F727

To claim this, I am signing this object:

@kevincharm
kevincharm / cloneFbx.js
Created November 19, 2017 14:12
Clone an already-loaded FBX model in three.js and be able to animate it. Adapted from: https://gist.github.com/cdata/f2d7a6ccdec071839bc1954c32595e87
const cloneFbx = (fbx) => {
const clone = fbx.clone(true)
clone.animations = fbx.animations
clone.skeleton = { bones: [] }
const skinnedMeshes = {}
fbx.traverse(node => {
if (node.isSkinnedMesh) {
skinnedMeshes[node.name] = node