Skip to content

Instantly share code, notes, and snippets.

View ardeay's full-sized avatar
🍊

Randy Apuzzo ardeay

🍊
View GitHub Profile
@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 / 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;
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;
geoFindMe();
@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)){
@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" />
'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) {
'use strict'
// Load environment variables from a .env file if available
// (This is used for adding environment variables in local development for testing. The "Deploy with Heroku"
// button will prompt for the variables in the Heroku setup process.)
require('dotenv').load({silent: true})
const express = require('express')
const app = express()
const bodyParser = require('body-parser')
<dropdown name="close-font-weight" name_friendly="Close Font Weight"> <!-- name friend is display to the user, name is the variable reference for LESS or SCSS -->
<category>9</category> <!-- category 9 is typography -->
<description/>
<sort>15</sort> <!-- position it loads in interface-->
<edit_in_content>1</edit_in_content>
<locked>0</locked>
<value><![CDATA[500]]></value>
<options>