Skip to content

Instantly share code, notes, and snippets.

Avatar

alan blount zeroasterisk

View GitHub Profile
@zeroasterisk
zeroasterisk / MyRequestInviteContainer.js
Last active May 5, 2016
redux-form validate functions passed into component
View MyRequestInviteContainer.js
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 Apr 19, 2016
React friendly utility to get a data object from a form onSubmit event
View formza.js
/**
* TEMP WIP Form helper utilities
*
*/
import _ from 'lodash';
export function getOptions(options) {
return _.extend(
{
@zeroasterisk
zeroasterisk / _service.md
Created Feb 5, 2016 — forked from naholyr/_service.md
Sample /etc/init.d script
View _service.md

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)
View autoSubscribe.js
// 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 Jul 6, 2015
[KyOSS Discuss] Help with PHP - using values in indexed array to traverse multi-dimensional array
View darren-pluck.php
<?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 Jun 26, 2015
nginx config (partial) caching reverse proxy example
View nginx_partial.conf
# ----------------------------¬
# 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 Jun 2, 2015
Dart scan for terms
View notes
In this example, I am scanning for all of these classes
https://github.com/awatson1978/clinical-ui-vocabulary/
@zeroasterisk
zeroasterisk / HttpsUrlTestShell.php
Last active Aug 29, 2015
Check any HTTPS URL to validate it - CakePHP Shell/Command
View HttpsUrlTestShell.php
<?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 Aug 29, 2015
Simple Loop Benchmarker
View benchmark-loops.php
<?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"
@zeroasterisk
zeroasterisk / nightwatch
Created Apr 20, 2015
nightwatch test runner script
View nightwatch
#!/usr/bin/env node
// -------------------
// nightwatchjs script running
// - automatically downloads the selenium jar if missing
// - automatically passes through all arguments to the runner.js
// -------------------
var fs = require('fs');
var path = 'Vendor/selenium-server-standalone-2.44.0.jar';