Skip to content

Instantly share code, notes, and snippets.

View chadokruse's full-sized avatar

Chad Kruse chadokruse

View GitHub Profile
@garguelles
garguelles / codeship-install-meteor.sh
Created October 2, 2016 11:38
Install meteor 1.3+ in codeship
# You can use nvm to install any Node.js (or io.js) version you require.
nvm install 4.5.0
nvm use 4.5.0
#install meteor normally
curl -o meteor_install_script.sh https://install.meteor.com/
chmod +x meteor_install_script.sh
sed -i "s/type sudo >\/dev\/null 2>&1/\ false /g" meteor_install_script.sh
./meteor_install_script.sh
export PATH=$PATH:~/.meteor/
# install deps
@manfromanotherland
manfromanotherland / formspree.html
Last active July 30, 2021 07:05
JS: Ajax send forms using the most excellent Formspree » http://formspree.io #snippet
<form id="contact-form" action="//formspree.io/your@email.com" method="post">
<input type="text" name="Name" placeholder="Name" required>
<input type="email" name="Email" placeholder="Email" required>
<textarea name="Message" cols="30" rows="6" placeholder="Message" required></textarea>
<!-- CONFIG -->
<input class="is-hidden" type="text" name="_gotcha">
<input type="hidden" name="_subject" value="Subject">
<input type="hidden" name="_cc" value="email@cc.com">
<!-- /CONFIG -->
<input class="submit" type="submit" value="Send">
@bobylito
bobylito / import.js
Created March 22, 2015 11:18
Import data to Algolia with Node.js streams.
// npm install agentkeepalive batch-stream csv-parse stream-transform
var HttpsAgent = require('agentkeepalive').HttpsAgent;
var Algolia = require('algolia-search');
var stream = require( 'stream' );
var parse = require('csv-parse');
var fs = require('fs')
var transform = require('stream-transform');
var Batch = require( 'batch-stream' );
@jhgaylor
jhgaylor / codeship_modulus_meteor_deploy.sh
Last active May 27, 2016 10:56
A script for deploying a meteor application to modulus.io using codeship.io for CI. Useful if your meteor app is not at the root of your repo.
#!/bin/sh
# assumes a clean install on a fresh linux box.
# for use w/ codeship.io
set -e
set -u
# a reference to the cloned repository's path
PWD=`pwd`
METEOR_APP_PATH="$PWD/MeteorApp"
@sjoerdvisscher
sjoerdvisscher / slackbot.js
Last active August 18, 2017 15:59
Create Slack bots with Meteor!
function slackpost(channel, name, text) {
HTTP.post("https://q42.slack.com/services/hooks/incoming-webhook", {"params":
{"token": "TODO: fill in token!",
"payload": JSON.stringify({
"channel": "#" + channel,
"username": name,
"text": text,
"icon_emoji": (name.indexOf("bot") > -1 ? ":ghost:" : "")
})
}}
require 'json'
require 'net/http'
# JSON parser tag, creating map for use in jekyll markdown
# Alex.Heneveld @ Cloudsoft Corp (remove spaces and add the .com)
# Released under APL 2.0
# usage: {% jsonball varname from TYPE PARAM %}
#
# where TYPE is one of {data,var,file,page}, described below