Skip to content

Instantly share code, notes, and snippets.

View eknowlton's full-sized avatar
🐧

Ethan Knowlton eknowlton

🐧
View GitHub Profile
@eknowlton
eknowlton / Chat.js
Last active January 10, 2018 19:51
ReactJS Chat integration with Slack
define(['react', 'jquery', 'moment'], function(React, jquery, moment) {
var ChatApp = {
users: [],
user: [],
messageCount: 0,
channel: [],
Message: React.createClass({
@eknowlton
eknowlton / mkvhost.sh
Created September 30, 2015 23:39
Script to automate creating virtualhosts on apache2 on a unix machine.
#!/bin/bash
# hosts folder
HOSTSDIR=/Users/ethan/Sites
# DOMAIN to set up, ex: working.dev
DOMAIN=$1
# User to set permissions for - the user account
USER=ethan
$(function(){
$("#myform").on('submit', function(e){
var isValid = true;
if($('#input').val().length == 0){
isValid = false;
}
if(!isValid){
e.preventDefault();
@eknowlton
eknowlton / push.php
Created April 25, 2017 17:33
Bitbucket Repository Push & Pull Webhook
<?php
/*
*
* This script manages webhooks from bitbucket.
* In order to automatically deploy updated source code
* without having to manually pull the repository.
*
* Bitbucket webhook will hit this script twice
* each time a commit is pushed to the repository.
* Once on production, and once on staging to
@eknowlton
eknowlton / extracte.go
Created January 10, 2018 19:50
CSV Go Parse
package main
import (
"bufio"
"encoding/csv"
"io"
"log"
"os"
"regexp"
"strings"
@eknowlton
eknowlton / server.sh
Created May 16, 2018 20:17
Rails 5 Server Script, with rbenv
#!/usr/bin/env bash
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
path="$(dirname `pwd`)"
if [ -f ../puma.pid ]; then
kill -9 $(cat "../puma.pid")
rm -rf ../puma.pid
@eknowlton
eknowlton / app.service
Created May 23, 2018 15:06
Rails Rbenv systemd configuration
# add to /etc/systemd/system/app.service
# manage app with 'systemctl'
[Unit]
Description=Puma HTTP Server
After=network.target
# Uncomment for socket activation (see below)
# Requires=puma.socket
This file has been truncated, but you can view the full file.
SCRIPT /Users/ethanknowlton/.vim/plugged/vim-leader-guide/syntax/leaderGuide.vim
Sourced 2 times
Total time: 0.000134
Self time: 0.000134
count total (s) self (s)
2 0.000012 if exists("b:current_syntax")
finish
endif
2 0.000004 let b:current_syntax = "leaderguide"
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
2 0.631610 0.001374 phpcomplete#CompletePHP()
3 0.566376 0.015479 phpcomplete#GetCurrentNameSpace()
18 0.468668 phpcomplete#GetTaglist()
14 0.186341 0.002689 <SNR>81_Lint()
14 0.173856 0.001637 ale#engine#RunLinters()
28 0.170811 0.000730 <SNR>84_RunLinter()
29 0.154387 0.000958 <SNR>19_on_window_changed()
19 0.153387 0.000968 airline#update_statusline()
FUNCTION airline#extensions#quickfix#inactive_qf_window()
Called 208 times
Total time: 0.001837
Self time: 0.001837
count total (s) self (s)
208 0.001182 if getbufvar(a:2.bufnr, '&filetype') is# 'qf' && !empty(airline#util#getwinvar(a:2.winnr, 'quickfix_title', ''))
call setwinvar(a:2.winnr, 'airline_section_c', '[%{get(w:, "quickfix_title", "")}] %f %m')
endif