Skip to content

Instantly share code, notes, and snippets.

View ardeay's full-sized avatar
🍊

Randy Apuzzo ardeay

🍊
View GitHub Profile
'use strict'
const moment = require('moment-timezone'); // a timezone dependency
const Slack = require('slack-node') // slacks interface dependency
const slack = new Slack() // instantiating slack
slack.setWebhook(process.env.SLACK_WEBHOOK_URL) // acccess the webhook url you pasted into Heroku in step 3
module.exports = function sendFormToSlack(request, callback) {
@ardeay
ardeay / slack-form.tpl
Last active June 6, 2016 21:24
Zesty.io Slack Hook Form
<form method="POST">
<input type="hidden" name="zlf" value="slack" />
<input type="text" name="first_name" placeholder="First Name" />
<br><br>
<input type="text" name="last_name" placeholder="Last Name" />
<br><br>
<input type="hidden" name="_zesty_webhook" value="https://zesty-form-slack-notifier.herokuapp.com/submission" />
@ardeay
ardeay / post_iterator.php
Last active June 2, 2016 21:18
Iterate through mixed (string, array, object) POST values gracefully
<?php
// clean function to run the array map through
function cleanFunc($input) {
if(is_array($input)){
return array_map("cleanFunc",$input);
} else if(is_object($input)){
geoFindMe();
function geoFindMe() {
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(success, error, geoOptions);
} else {
alert("Geolocation services are not supported by your web browser.");
}
}
function success(position) {
var latitude = position.coords.latitude;
@ardeay
ardeay / echomtg_method_example.java
Created April 13, 2016 16:30
Example of using the EchoMTGAPI Wrapper Singleton with a call back in an activity or fragment class
// auth example, would be inside an activity or fragment class method
SharedPreferences sharedPref;
sharedPref = getActivity().getPreferences(Context.MODE_PRIVATE);
String email = "your@email.com";
String pass = "asdfsbfsbsadfsa";
EchoMTGJavaAPIWrapper.getInstance(getActivity().getApplicationContext()).authRequest(new EchoMTGJavaAPIWrapper.EchoCallback(){
@Override
public void onSuccess(String result){
JSONObject jsonObject= null;
String token = null;
@ardeay
ardeay / font-awesome.less
Created January 14, 2016 21:58
Font Awesome with CDN for inline
@font-face {
font-family: 'FontAwesome';
src: url('//netdna.bootstrapcdn.com/font-awesome/4.5.0/fonts/fontawesome-webfont.eot?v=4.5.0');
src: url('//netdna.bootstrapcdn.com/font-awesome/4.5.0/fonts/fontawesome-webfont.eot?#iefix&v=4.5.0') format('embedded-opentype'), url('//netdna.bootstrapcdn.com/font-awesome/4.5.0/fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'), url('//netdna.bootstrapcdn.com/font-awesome/4.5.0/fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'), url('//netdna.bootstrapcdn.com/font-awesome/4.5.0/fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-al
@ardeay
ardeay / social_curator_example
Created January 14, 2016 21:57
Social Curator Zesty.io Example
{{each social_feed as social_item }}
<div class="social-example {{social_item.source}}">
<div class="z-row">
<div class="col-1/3">
<h1>{{social_item.title}}</h1>
<em>Post by {{social_item.username}}</em>
</div>
@ardeay
ardeay / page.tpl
Last active November 17, 2015 18:33
<h1>Page Title</h1>
<hr/>
{{if @test_cookie == 'cookie content'}}
<h2>{{@test_cookie}}</h2>
<p>{{page.personlized_content}}</p>
{{else}}