Skip to content

Instantly share code, notes, and snippets.

View chris-burgin's full-sized avatar

Chris Burgin chris-burgin

View GitHub Profile
@chris-burgin
chris-burgin / coc-settings.json
Last active June 25, 2020 18:39
Chris Burgin Vim
{
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact",
"typescript.tsx",
"graphql"
@chris-burgin
chris-burgin / quills.zsh-theme
Created April 3, 2018 13:08
Custom theme using Honukai as a starting point.
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
# Directory info.
local current_dir='${PWD/#$HOME/~}'
# VCS
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
@chris-burgin
chris-burgin / MessageComponentPure.jsx
Created January 31, 2018 18:52
An example using PureComponent that extends on the MessageComponent example.
class Message extends PureComponent {
render() {
return <li style={{ margin: "10px" }}> {this.props.message} </li>
}
}
@chris-burgin
chris-burgin / SingleMessageComponentSCU.jsx
Created January 31, 2018 18:48
A breakdown of the MessageComponent that shows an example using shouldComponentUpdate()
class Message extends Component {
shouldComponentUpdate(nextProps) {
if (this.props.message === nextProps.message) {
return false
}
return true
}
render() {
@chris-burgin
chris-burgin / MessageComponent.jsx
Created January 31, 2018 18:38
A component that stores an exact history of what you type.
import React, { Component } from "react"
export default class App extends Component {
constructor() {
super()
this.state = { messages: [] }
// binds
this._getLastMessage = this._getLastMessage.bind(this)
this._onMessageChange = this._onMessageChange.bind(this)
@chris-burgin
chris-burgin / PureComponentExample.js
Created January 30, 2018 22:21
An example of PureComponent in react
import React, { Component, PureComponent } from "react"
export default class App extends Component {
constructor() {
super()
this.state = { messages: [] }
// binds
this._getLastMessage = this._getLastMessage.bind(this)
this._onMessageChange = this._onMessageChange.bind(this)
@chris-burgin
chris-burgin / chrisburgin95_aliases.sh
Last active December 4, 2017 15:07
Aliases I use on a daily basis to make my life just a bit easier.
# Place these in your ZSH or BASH config
# Other
alias please='sudo $(fc -ln -1)' # runs the previous command with `sudo`
# Editors
alias c="code ." # open the current directory in vscode
alias v="vim" # vim shortcut
# npm
alias nr="npm run " # npm run shortcut
@chris-burgin
chris-burgin / store.js
Created April 16, 2017 23:34
Object Literal Redux Store Reducer
// ****************
// Reducer Imports
// ****************
import {
// users
DELETEUSER,
UPDATEUSER,
ADDUSER,
ADDUSERS
} from "./reducers/index.js"
@chris-burgin
chris-burgin / generateAWSTemp.php
Created January 23, 2017 17:57
Generating Amazon AWS Temporary Link
<?php
if(!function_exists('el_crypto_hmacSHA1')){
/**
* Calculate the HMAC SHA1 hash of a string.
*
* @param string $key The key to hash against
* @param string $data The data to hash
* @param int $blocksize Optional blocksize
* @return string HMAC SHA1