Skip to content

Instantly share code, notes, and snippets.

View zeroasterisk's full-sized avatar

alan blount zeroasterisk

View GitHub Profile
@zeroasterisk
zeroasterisk / DockerfileForBundle
Created July 29, 2016 17:01
Meteor build -> Docker (custom image, from bundle)
FROM node:4.4.7-slim
MAINTAINER Alan Blount <alan@zeroasterisk.com>
RUN npm install -g npm@3 pm2 \
&& npm cache clear
# TODO: remove when https://github.com/npm/npm/issues/9863 is fixed
RUN cd $(npm root -g)/npm \
&& npm install fs-extra \
&& sed -i -e s/graceful-fs/fs-extra/ -e s/fs\.rename/fs.move/ ./lib/utils/rename.js
@zeroasterisk
zeroasterisk / MyRequestInviteContainer.js
Last active May 5, 2016 21:42
redux-form validate functions passed into component
import { Meteor } from 'meteor/meteor';
import { Email } from 'meteor/email';
import { createContainer } from 'meteor/react-meteor-data';
import { Texts } from '../../../api/Texts/collection';
import { Users } from '../../../api/Users/collection';
import { schemaInviteRequest, sendInviteRequest } from '../../../api/Invites/methods';
import { Bert } from 'meteor/themeteorchef:bert';
@zeroasterisk
zeroasterisk / formza.js
Created April 19, 2016 21:26
React friendly utility to get a data object from a form onSubmit event
/**
* TEMP WIP Form helper utilities
*
*/
import _ from 'lodash';
export function getOptions(options) {
return _.extend(
{
@zeroasterisk
zeroasterisk / _service.md
Created February 5, 2016 14:43 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
// Subscriptions automatic helpers
autoSub = { readys: {}, managers: {} };
autoSubscribe = function(T, subKey, paramKey) {
T.onCreated(function() {
var self = this;
if (!_.has(autoSub.managers, subKey)) {
autoSub.managers[subKey] = new SubsManager();
}
if (!_.has(autoSub.readys, subKey)) {
autoSub.readys[subKey] = new ReactiveVar();
@zeroasterisk
zeroasterisk / darren-pluck.php
Created July 6, 2015 14:59
[KyOSS Discuss] Help with PHP - using values in indexed array to traverse multi-dimensional array
<?php
/**
* pluck out a value from a nested array, based on a $path
* where $path is a single-dim list of keys.
*
* @param array $form (multi-dim)
* @param array $path (single dim)
* @reutrn mixed $value from $form, in $path
@zeroasterisk
zeroasterisk / nginx_partial.conf
Created June 26, 2015 01:48
nginx config (partial) caching reverse proxy example
# ----------------------------¬
# Proxy config/example
# (optional config used inside server/location blocks)¬
# context - server, location¬
# link: http://wiki.nginx.org/HttpProxyModule#proxy_cache¬
# link: http://nginx.org/en/docs/http/ngx_http_proxy_module.html¬
# link: http://nginx.org/en/docs/http/ngx_http_upstream_module.html
# link: http://www.packtpub.com/article/using-nginx-reverse-proxy¬
# ----------------------------¬
@zeroasterisk
zeroasterisk / notes
Created June 2, 2015 17:46
Dart scan for terms
In this example, I am scanning for all of these classes
https://github.com/awatson1978/clinical-ui-vocabulary/
@zeroasterisk
zeroasterisk / HttpsUrlTestShell.php
Last active August 29, 2015 14:19
Check any HTTPS URL to validate it - CakePHP Shell/Command
<?php
/**
* Check any HTTPS URL to validate it
*
* - checkdomain verifies the SSL cert only (working, slow)
* - checkcurl verifies the URL can be loaded via CURL (not working)
*
*/
App::uses('HttpSocket', 'Utility');
@zeroasterisk
zeroasterisk / benchmark-loops.php
Last active August 29, 2015 14:19
Simple Loop Benchmarker
<?php
/**
* Simple Benchmarker for PHP While Loops
*
* USES pcntl_fork() to split to different processes,
* so we assure RAM utilization doesn't "bleed"
*
* Usage:
* We are using php files for the large test, just to get a bunch of "random"