Skip to content

Instantly share code, notes, and snippets.


Charles Peterson Artistan

View GitHub Profile
swarupdonepudi /
Created Aug 13, 2017
Steps to install etcher-cli on OSX.
  1. Download the etcher-cli tar file from the official downloads page

curl -O
  1. Extract the tar file

tar fvx path/to/cli.tar.gz
  1. Create the directory in /opt folder and move the contents to the new folder
mkdir -p /opt/etcher-cli
mv -R Etcher-cli-1.1.2-darwin-x64 /opt/etcher-cli
  1. Add /opt/etcher-cli to PATH variable. This needs to be added to your login shell profile. I have added it to ~/.zshrc file.

Aligning images

left alignment

This is the code you need to align images to the left:

<img align="left" width="100" height="100" src="">
matusk / mysql-load-data-infile.php
Created Sep 16, 2016
View mysql-load-data-infile.php
$dbHost = '';
$dbName = '';
$dbTable = '';
$dbUser = '';
$dbPassword = '';
$fieldSeparator = ',';
$lineSeparator = "\n";
$csvFile = 'filename.csv';
Artistan / 1. jquery.ejax-query-datatables.js
Last active Mar 8, 2016
elastic search datatables query
View 1. jquery.ejax-query-datatables.js
/*! Ejax Datatables - v0.0.1 - 2016-02-19
* Copyright (c) 2016 charles peterson; Licensed MIT */
(function ($) {
* debug_ejax = console.log alot of crap
* elastic_json = the query for elastic
* pkey = key to define the object data structure if y`ant to
* serverUrl = elasticsearch server search path
* callbackSearch = callback to change the search for your elastic_json based on databases search updates made by the user
* callbackRow = callback to modify result row
sphaero /
Last active Jul 8, 2020
Install & build gstreamer from git
#!/bin/bash --debugger
set -e
if grep -q BCM2708 /proc/cpuinfo; then
echo "RPI BUILD!"
[ -n "$1" ] && BRANCH=$1
benstr /
Created Jan 31, 2014
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


dylanlindgren / DateAccessorTrait.php
Last active Oct 10, 2018
Extend Carbon in Laravel with your own methods and use it on a per-model basis as a replacement for Carbon
View DateAccessorTrait.php
// app/traits/DateAccessorTrait.php
// This trait contains a copy and paste of the identically named methods
// from Laravel's Eloquent model, however anything referring to a Carbon
// instance is replaced with an instance of our own MyCarbon class.
// Ensure the /app/traits directory is included in your composer.json for autoload
trait DateAccessorTrait
View widget-template.js
$.widget("ui.mywidget", {
options: {
autoOpen: true
_create: function(){
// by default, consider this thing closed.
You can’t perform that action at this time.