Skip to content

Instantly share code, notes, and snippets.

View markshust's full-sized avatar
🤓
Currently exploring building production apps with Claude Code & AI.

Mark Shust markshust

🤓
Currently exploring building production apps with Claude Code & AI.
View GitHub Profile
@markshust
markshust / gist:b5239e2daf3546af013e
Last active December 17, 2017 18:01
sample mongodb setup - create user for db dbname with admin access
use admin;
// create superuser
db.createUser({user: "username", pwd: "PLAINTEXTPASSWORD", roles: ["userAdminAnyDatabase"]});
// create oplog user
db.createUser({user: "oplogger", pwd: "PLAINTEXTPASSWORD", roles: [{role: "read", db: "local"}]})
// create user for another database
use foo;
@markshust
markshust / get.js
Created January 20, 2016 21:55
underscore mixin for something like lodash's _.get -- just use dot notation for arrays within objects, _.get(object, 'a.0.b.c');
_.mixin({
get: function (obj, key) {
var type = typeof key;
if(typeof obj === 'undefined' || type === 'undefined')
return undefined;
if (type == 'string' || type == "number") {
key = ("" + key).replace(/\[(.*?)\]/,/\[(.*?)\]/, function (m, key) { //handle case where [1] may occur
return '.' + key.replace(/["']/g,/["']/g, ""); //strip quotes
@markshust
markshust / install-comodo-ssl-cert-for-nginx.rst
Created February 5, 2016 06:31 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@markshust
markshust / gist:586a5c7587474d96d571
Last active February 6, 2016 03:52
profile m13b8
=> Started proxy.
| (#1) Profiling: ProjectContext prepareProjectForBuild
=> Started MongoDB.
| Building local packages /
| files.readFile 685 ms (3)
| files.unlink 1 ms (1)
| sqlite query 377 ms (3)
| bundler.readJsImage...............................................8 ms (1)
| files.readFile 7 ms (11)
| other bundler.readJsImage 1 ms
@markshust
markshust / gist:32d9eac050e1ab1ed893
Created March 23, 2016 18:02
meteor-keen-js debug
Marks-MacBook-Air:meteor-keen-js markshust$ METEOR_PROFILE=1 meteor
[[[[[ ~/Sites/meteor-keen-js ]]]]]
=> Started proxy.
| (#1) Profiling: ProjectContext prepareProjectForBuild
=> Started MongoDB.
| Loading package standard-minifier-css... /
| files.exists 0 ms (1)
| files.readFile 94 ms (2)
| files.unlink 1 ms (1)
@markshust
markshust / docker-compose.yml
Last active April 19, 2016 19:46
Mage Inferno Docker Compose 4.0.0-rc0
# Mage Inferno Docker Compose (https://github.com/mageinferno/magento2-docker-compose)
# Version 4.0.0rc1
app:
image: mageinferno/magento2-nginx:1.9.14-0-rc2
links:
- phpfpm
- db
volumes_from:
- appdata
@markshust
markshust / gist:fde237fd88becdb4b6a3d8cfa2a0df32
Created June 29, 2016 20:34
meteor npm run lint 1.4-beta.6
Marks-MacBook-Air:myapp markshust$ meteor npm run lint
> myapp@ lint /Users/markshust/Sites/myapp
> eslint .
Property 'Symbol(Symbol.iterator)_9.k9psb8ommz82rzfr' of object [object Map] is not a function
TypeError: Property 'Symbol(Symbol.iterator)_9.k9psb8ommz82rzfr' of object [object Map] is not a function
at EventEmitter.ProgramExit (/Users/markshust/Sites/myapp/node_modules/eslint-plugin-import/lib/rules/export.js:93:149)
at EventEmitter.emit (events.js:117:20)
at NodeEventGenerator.leaveNode (/Users/markshust/Sites/myapp/node_modules/eslint/lib/util/node-event-generator.js:49:22)
@markshust
markshust / composer.js
Created August 5, 2016 06:29
WIP: custom automagic composer for mobx + meteor
import React, { createElement, Component, PropTypes } from 'react';
import { observer } from 'mobx-react';
import { _ } from 'meteor/underscore';
class Container extends Component {
componentWillMount() {
const { onMount } = this.props;
if (typeof onMount === 'function') onMount();
}
@markshust
markshust / toggleClick.js
Created December 27, 2016 17:05
jquery helper to replace deprecated jquery.toggle click event
$.fn.toggleClick = function () {
var functions = arguments;
return this.each(function () {
var iteration = 0;
$(this).click(function () {
functions[iteration].apply(this, arguments);
iteration = (iteration + 1) % functions.length;