This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"net" | |
) | |
//var connections []net.Conn | |
//var messaging chan string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Blink < ActiveRecord::Base | |
belongs_to :blink_category | |
belongs_to :blink_sub_category | |
validates_presence_of :text, :message=>"story can't be blank" | |
validates_length_of :text, maximum: 150 | |
validates_presence_of :occured | |
validates_presence_of :blink_category_id | |
belongs_to :life | |
has_many :blink_likes, dependent: :destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Icon Theme] | |
Name=PLEX | |
Comment=PLEX ICON PACK | |
Directories=Apps | |
[Apps] | |
Size=512 | |
Type=Scalable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |