Skip to content

Instantly share code, notes, and snippets.

Avatar
☄️

Dan Minshew newswim

☄️
View GitHub Profile
@newswim
newswim / deeper_delete.js
Created Mar 10, 2017
A super simple CLI for making REST requests to Shopify. Modify with whatever methods you want!
View deeper_delete.js
// README: https://gist.github.com/newswim/a99b09a13e80c262d61915f0f28a51b1
// For instructions on `shopify-api-node`
// see: https://github.com/christophergregory/shopify-node-api
#!/usr/bin/env node
"use strict"
const clear = require('clear')
const inquirer = require('inquirer')
@newswim
newswim / readme.md
Last active Aug 3, 2017
Deep Delete - readme
View readme.md

Start-up

  • Clone this repo
  • yarn or npm install
  • Create a file config/secrets.json -- Only the first 4 fields are required
{
  "api_key" : "",
  "shopName" : "",
  "password" : "",
@newswim
newswim / init.coffee
Last active Feb 26, 2017
Atom Sync Settings
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@newswim
newswim / denton_canopy.json
Last active Feb 4, 2017
Data from Canopy Planner
View denton_canopy.json
{"status":"OK","personal_settings":{"account":{"login_notes":"","pid":1,"admin_1_manage_org":true,"admin_2_manage_org":false,"admin_1_manage_users":true,"admin_2_manage_users":false,"request_accounts":false,"admin_3_manage_org":false,"admin_3_manage_users":false,"admin_1_zoom_to_data_on_login":true,"admin_2_restrict_to_own_data":false,"default_base_user":"public_1","with_login_sc":true,"from_email":"info@planitgeo.com","admin_2_zoom_to_data_on_login":false,"admin_3_zoom_to_data_on_login":false,"public_1_zoom_to_data_on_login":false,"admin_1_restrict_to_own_data":false,"admin_3_restrict_to_own_data":true,"public_1_restrict_to_own_data":false,"to_email":null,"default_logged_in_user":"admin_2","with_forgot_pword":true,"with_mng_account":true,"users_extra_parameters":null,"with_self_reg_role":false,"overwrite_user_type_self_reg":true,"admin_4_manage_org":false,"admin_4_manage_users":false,"admin_4_zoom_to_data_on_login":false,"admin_4_restrict_to_own_data":true,"admin_5_manage_org":false,"admin_5_manage_users":fa
@newswim
newswim / object-create.js
Created Nov 17, 2016
Object.create simple polyfill
View object-create.js
/**
* @param {object} o - this object will be the Prototype of the newly created object.
*/
if (!Object.create) {
Object.create = function (o) {
if (arguments.length > 1) {
throw new Error('Object.create implementation only accepts the first parameter.');
}
function F() {}
@newswim
newswim / dump.raw
Created Oct 19, 2016
Compiling gcc in order to get through `rvm requirements`
View dump.raw
ln -s ../../../Cellar/gcc49/4.9.3/share/man/man7/fsf-funding-4.9.7 fsf-funding-4.9.7
ln -s ../../../Cellar/gcc49/4.9.3/share/man/man7/gfdl-4.9.7 gfdl-4.9.7
ln -s ../../../Cellar/gcc49/4.9.3/share/man/man7/gpl-4.9.7 gpl-4.9.7
ln -s ../Cellar/gcc49/4.9.3/lib/gcc gcc
==> Summary
🍺 /usr/local/Cellar/gcc49/4.9.3: 1,181 files, 196M, built in 38 minutes 19 seconds
➜ ~ rvm requirements -v
Checking requirements for osx.
^C% ➜ ~ rvm requirements --verbose
Checking requirements for osx.
@newswim
newswim / example.js
Created Sep 27, 2016
Fetching data with React's constructor
View example.js
// I did not write this.
var url = "https://jsonplaceholder.typicode.com/albums"
// Auto unwrap the response as we want the data not the full headers for this simple example
const stringifyResponse = response => {
if (response.status >= 400) throw new Error(response)
return response.headers.get("Content-Type").includes("application/json") ? response.json() : response.text()
}
View gist:80620811d6843ebedad95f51b1715a66
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
bcrypt = require('bcrypt'),
SALT_WORK_FACTOR = 10;
var UserSchema = new Schema({
username: { type: String, required: true, index: { unique: true } },
password: { type: String, required: true }
});
@newswim
newswim / hapijs-rest-api-tutorial.md
Created May 9, 2016 — forked from agendor/hapijs-rest-api-tutorial.md
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js
View hapijs-rest-api-tutorial.md
You can’t perform that action at this time.