Skip to content

Instantly share code, notes, and snippets.

View FreekingDean's full-sized avatar
🕴️
MIBSL

Dean Galvin FreekingDean

🕴️
MIBSL
  • Montclair, NJ
View GitHub Profile
String.prototype.padLeft = function(ch, n) {
var t = createPadding(ch,n, this)
return t.concat(this);
};
String.prototype.padRight = function(ch, n) {
var t = createPadding(ch,n, this)
return this.concat(t);
};
func dynaFace(input []map[string]*dynamodb.AttributeValue, model interface{}) (output []interface{}) {
log.Println(reflect.TypeOf(model))
output = make([]interface{}, 0)
modelType := reflect.TypeOf(model)
for _, item := range input {
newMdl := reflect.New(modelType)
log.Println(newMdl.Kind())
log.Println(reflect.Ptr)
for fieldIndex := 0; fieldIndex < newMdl.Elem().NumField(); fieldIndex++ {
field := newMdl.Field(fieldIndex)
func dynaFace(input []map[string]*dynamodb.AttributeValue, model interface{}) (output []interface{}) {
log.Println(reflect.TypeOf(model))
output = make([]interface{}, 0)
modelType := reflect.TypeOf(model)
for _, item := range input {
newMdl := reflect.New(modelType)
log.Println(newMdl.Kind())
log.Println(reflect.Ptr)
for fieldIndex := 0; fieldIndex < modelType.NumField(); fieldIndex++ {
field := newMdl.Field(fieldIndex)
user := make(map[string]interface{}) // our new user
for k, v := range awsUserMap {
items := reflect.ValueOf(v)
var realValue interface{}
for i := 0; i < items.NumField(); i++ {
realValue = items.Field(i).Interface()
if (realValue isnt nil) {
break;
}
package main
import (
"flag"
"fmt"
"net"
)
//var connections []net.Conn
//var messaging chan string
@FreekingDean
FreekingDean / StripeModel.rb
Created June 29, 2015 18:55
Is this the goodererest way to do things?
class StripeModel < ActiveRecord::Base
before_validate :add_customer, on: :create
validates_presence_of :customer_id
def get_customer
customer = Stripe::Customer.retrieve(customer_id)
end
def add_subscription(plan, quantity)
begin
Blink Share
#{@blink.life.name} wants to share an important Lifeblink moment with you.
=link_to "Click here to view it."
Family Member Invite
#{@subject.life.name} wants to add you as their #{@subject.relationship_type} on Lifeblink.
Please click the link below to complete the sign up process and approve their request.
=link_to "Join Lifeblink"
[Icon Theme]
Name=PLEX
Comment=PLEX ICON PACK
Directories=Apps
[Apps]
Size=512
Type=Scalable
@FreekingDean
FreekingDean / gist:8644211
Created January 27, 2014 07:00
Arduino Transmitter
#include <SPI.h>
#include <RF24.h>
#include <nRF24L01.h>
#include <RF24_config.h>
/*
* This is a simple arduino module set to be a transmitter, currently for
* firework Efuse Slats && holiday lightshow spectacular.
* Author: Dean Galvin
* Creation Date: 12-9-2013