Skip to content

Instantly share code, notes, and snippets.

View aarondancer's full-sized avatar
:shipit:

Aaron Dancer aarondancer

:shipit:
View GitHub Profile
@aarondancer
aarondancer / powerswitch.js
Last active April 16, 2019 15:06
Power Switch
load('api_config.js');
load('api_events.js');
load('api_gpio.js');
load('api_mqtt.js');
load('api_net.js');
load('api_sys.js');
load('api_timer.js');
load('api_rpc.js');
let led = Cfg.get('pins.led');
@aarondancer
aarondancer / settings.json
Created May 16, 2018 18:55
settings.json
{
"public": {
"analyticsSettings": {
"Google Analytics" : {"trackingId": "UA-104749558-1"}
}
},
"private": {
"TWILIO": {
"FROM": "+18322713362",
"SID": "AC0834abd123e34878a656db23aa132f89",

Using ES6 Template string:

function createCard(title, content, picture) {
  return `<div class="card" style="width: 18rem;">
    <img class="card-img-top" src="${picture}" alt="Card image cap">
    <div class="card-body">
      <h5 class="card-title">${title}</h5>
      <p class="card-text">${content}</p>
      <a href="#" class="btn btn-primary">Go somewhere</a>
    </div>
Verifying my Blockstack ID is secured with the address 1NDkgUv9fmkgZUhw4G6foh6tbgjUm6Pxdk https://explorer.blockstack.org/address/1NDkgUv9fmkgZUhw4G6foh6tbgjUm6Pxdk
@aarondancer
aarondancer / schema.js
Last active June 8, 2016 05:22
CodeRED App Schema
User: {} //handled by Meteor
Application: {
User: id
Approved: bool
Approved By: id
Is Coming: bool
Checked In: date
Role (optional) {
Organizer: bool
Mentor: bool
@aarondancer
aarondancer / duplicate.js
Created October 5, 2015 19:18
Clone elements in jQuery
/*
The following function takes all elements on a page marked with the `clone` attribute,
and creates a clone of the element maintaining all of the classes the original element
had
*/
function duplicate() {
$("[clone]").each(function(){
var original = $("#" + $(this).attr("clone")).clone();
var classes = $(this).attr('class').split(/s+/);
@aarondancer
aarondancer / strhas.php
Created June 11, 2015 19:14
A simple, minimal function for checking if a substring exists inside a string that accepts all types including arrays.
function strhas($haystack, $needle) {
if (gettype($needle) != "array") return (strpos($haystack, $needle) !== false);
foreach ($needle as $n) if (strpos($haystack, $n) !== false) return true;
}
@aarondancer
aarondancer / CodeRED Judging Submission Summation Script.vb
Last active August 29, 2015 14:18
CodeRED Judging Submission Summation Script
' This script is/was used for tallying up the score of participants
' Input is from Google Forms Sheet
' Input Format
' Column 1 - Date Submitted (Unused)
' Column 2 - Table Number
' Column 3 - Creativity (1 - 10)
' Column 4 - Technicality (1 - 10)
' Column 5 - Aesthetics (1 - 10)
' Column 6 - Functionality (1 - 10)
@aarondancer
aarondancer / Über Basic String Encryption
Created March 10, 2015 22:28
A really really basic example of a string encryption algorithm. Made for a friend. Also Tabs > Spaces
#include <iostream>
#include <clocale>
#include <string>
using namespace std;
int main(){
setlocale(LC_ALL, "");
while (true) {
string c, e;