Skip to content

Instantly share code, notes, and snippets.

View zeroasterisk's full-sized avatar

alan blount zeroasterisk

View GitHub Profile
@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 / cron-sites-prod
Last active December 31, 2015 06:38
simple cron running script for a collection of sites which may or may not exist...
#!/bin/bash
#https://gist.github.com/zeroasterisk/7948457
ENV='prod'
ROOT="/var/www/${ENV}/"
SITES=( ao sp ot pt )
# foreach site
for i in "${SITES[@]}"
@zeroasterisk
zeroasterisk / hardware.js
Created October 21, 2013 12:51
Hardware interface information/exchange for MeteorJS + Meteor-Cordova https://github.com/SpaceCapsule/Meteor-Cordova
/**
* Utility functions to help determine what kind of device you are on,
* and what it's capabilities are...
*
* This is very much a "custom" implementation to my needs, but may help as
* a starting point for others and perhaps for more generic Hardware
* information.
*
* Current version relies on Meteor-Cordova (the iframe appraoch)
* https://github.com/SpaceCapsule/Meteor-Cordova
@zeroasterisk
zeroasterisk / update.sh
Last active December 21, 2015 15:19
Update script for `bootstrap3-less`
#!/bin/bash
# ========
# this is a simple script to update with the latest release from bootstrap's repo
# which should be located at ./bootstrap
#
# git clone https://github.com/twbs/bootstrap.git
#
# https://github.com/twbs/bootstrap/blob/master/Gruntfile.js#L43
#
<?php
public function getSynonyms($term) {
$HttpSocket = new HttpSocket();
$synonyms = $HttpSocket->get("http://words.bighugelabs.com/api/2/b9f80d07c1ea496c33b868e6c610cd11/{$term}/json");
$synonyms = json_decode($synonyms, true);
if (!is_array($synonyms) || empty($synonyms)) {
return array();
}
return $synonyms;
}
@zeroasterisk
zeroasterisk / index.html
Created July 31, 2013 07:35
PhoneGap + MeteorJS integration... HTML/JS lives in PhoneGap (on device), and it does an AJAX call to Meteor server/URL, then replaces the current page. (doesn't work in a browser, but does in PhoneGap, CORS = more relaxed)
<!DOCTYPE html>
<html manifest="/app.manifest">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Meteor Rider Example</title>
</head>
<body data-meteor-url="http://leaderboard.meteor.com/">
@zeroasterisk
zeroasterisk / index.html
Created July 31, 2013 07:35
PhoneGap + MeteorJS integration... HTML/JS lives in PhoneGap (on device), and it does an AJAX call to Meteor server/URL, then replaces the current page. (doesn't work in a browser, but does in PhoneGap, CORS = more relaxed)
<!DOCTYPE html>
<html manifest="/app.manifest">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Meteor Rider Example</title>
</head>
<body data-meteor-url="http://leaderboard.meteor.com/">