Skip to content

Instantly share code, notes, and snippets.

View Jinksi's full-sized avatar

Eric Jinks Jinksi

View GitHub Profile
@Jinksi
Jinksi / encodeWidget.js
Created February 21, 2018 05:37
Netlify CMS base64 encode widget
var EncodeControl = createClass({
handleChange: function (e) {
this.props.onChange(btoa(e.target.value.trim()))
},
render: function () {
var value = this.props.value ? atob(this.props.value) : ''
return h('input', {
type: 'text',
value: value,
@Jinksi
Jinksi / writeNumbers.js
Created November 28, 2017 05:08
writeNumbers
const writeNumbers = () => {
const categories = ['scans', 'fatLoss', 'muscleGained']
// base number is inside span
// number to increase by is inside data-increase attribute
const startDate = new Date('Nov 21 2017')
const now = new Date()
const difference = now - startDate
const ms = 1000
const seconds = 60
const minutes = 60
@Jinksi
Jinksi / fetch-firebase-data.js
Last active July 21, 2020 13:19
Fetch firebase REST API data and save to .json file
const fetch = require('node-fetch')
const fs = require('fs')
const config = {
endpoint: 'https://FIREBASE_PROJECT.firebaseio.com/',
pathsToFetch: [
// database nodes
'pages',
'posts'
],
@Jinksi
Jinksi / gc2018.md
Last active July 14, 2017 01:37
GC2018
@Jinksi
Jinksi / gist:d9856f3a053ce7ff29e39d51d6941da0
Created July 5, 2017 23:30
Serverpilot disable display php errors server-wide
echo 'display_errors = false' | sudo tee --append /etc/php5.4-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php5.5-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php5.6-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php7.0-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php7.1-sp/php.ini && cat /etc/php5.4-sp/php.ini && cat /etc/php5.5-sp/php.ini && cat /etc/php5.6-sp/php.ini && cat /etc/php7.0-sp/php.ini && cat /etc/php7.1-sp/php.ini && sudo service php5.4-fpm-sp restart && sudo service php5.5-fpm-sp restart && sudo service php5.6-fpm-sp restart && sudo service php7.0-fpm-sp restart && sudo service php7.1-fpm-sp restart
@Jinksi
Jinksi / vultrsnapshotcronjob
Last active July 3, 2017 06:16
Vultr Snapshot Cronjob
0 0 */5 * * /usr/local/bin/vultr -k VULTR_API snapshot create -s SUBID >> /var/log/vultr.log
@Jinksi
Jinksi / 0_reuse_code.js
Created November 15, 2016 01:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Jinksi
Jinksi / newbox
Last active September 27, 2016 05:00
#!/usr/bin/env python
import subprocess, fileinput, sys, os
PURPLE = "\033[95m"
WHITE = "\033[00m"
GREEN = "\033[92m"
cwd = os.getcwd()
@Jinksi
Jinksi / webhook.sh
Last active August 27, 2019 14:09
Bash script for Gitlab Webhook setup & Wordpress
#!/bin/bash
# v0.9.0
# Run from Wordpress installation directory
# DEFINE COLORS
RED='\033[0;31m' # error
GRN='\033[0;32m' # success
BLU='\033[0;34m' # task
BRN='\033[0;33m' # headline
NC='\033[0m' # no color
@Jinksi
Jinksi / vv-blueprints.json
Last active May 31, 2016 23:22
VV Blueprint
{
"flex-with-benefits": {
"themes": [
{
"location": "Jinksi/flex-with-benefits",
"activate": true
}
],
"mu_plugins": [],
"plugins": [