Skip to content

Instantly share code, notes, and snippets.

Dan Minshew newswim

Block or report user

Report or block newswim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
@newswim
newswim / output
Created Apr 20, 2016
stylus parsing error
View output
danbook% meteor
[[[[[ ~/Documents/dev/savi/arrow-react-toolbox ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Errors prevented startup:
While processing files with savi:css-modules (for target web.browser):
/client/modules/core/components/home_right.m.styl: CSS modules stylus compiler error: {"stack":"ParseError: {}/client/modules/core/components/home_right.m.styl:4:35\n at
Object.Future.wait (/Users/dm/Documents/dev/savi/arrow-react-toolbox/packages/css-modules/.npm/plugin/mss/node_modules/fibers/future.js:395:16)\n at StylusProcessor.load
You can’t perform that action at this time.