Skip to content

Instantly share code, notes, and snippets.

View tealtail's full-sized avatar

Alicia Lauerman tealtail

View GitHub Profile
@tealtail
tealtail / cdyne_smsnotify_optin.aspx
Created June 7, 2012 19:27
Send an SMS opt-in message and detect for the presence of a keyword response from users. This is an example of an SMS Alerts system opt-in using CDYNE's SMSNotify! API from within a legacy ASP.NET WebForms application.
<form id="form1" runat="server">
<h2>Enter Your Mobile Device Number to Register</h2>
<p>CDYNE Alerts lets you receive school, organization, or community alerts over SMS.</p>
<label for="mobile">Mobile Number</label>
<input type="text" runat="server" id="mobile" class="textbox" placeholder="ex. '(555)-555-5555'" required="required" />
<p>
<label class="checkbox">
@tealtail
tealtail / simplesmsnotify_ruby.rb
Created September 24, 2012 20:43
Simple CDYNE SMSNotify! with ruby
require 'net/http'
require 'uri'
uri = URI("http://sms2.cdyne.com/sms.svc/SimpleSMSsend")
params = {
:PhoneNumber => 'YourPhoneNumber',
:Message => 'Hello From SMSNotify!',
:LicenseKey => 'YourLicenseKey'
}
@tealtail
tealtail / HandleBarsAssetHandler.cs
Created July 19, 2013 15:12
Handlebars Bundle Transformer class for compiling Handlebars with ASP.NET MVC4 Bundles. Works well, so I thought I'd save it for reuse.
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Caching;
using System.Web.Script.Serialization;
using BundleTransformer.Core;
using System.Linq;
using BundleTransformer.Core.Assets;
using BundleTransformer.Core.Configuration;
using BundleTransformer.Core.FileSystem;
# Define Animal as a class
class Animal
# Set up accessors and mutators for the attributes of an Animal
# attr_accessor sets up both for you
attr_accessor :name, :age, :gender, :species, :toys
# Used when creating a new animal.
# Example:
# Animal.new('Timmy', 4, 'male', 'toad')
@tealtail
tealtail / drill.md
Last active December 24, 2015 16:09 — forked from phlco/drill.md

Emergency WDI Pick me up

Prompt

For today's drill, we're going to be creating a site like Emergency Compliment, except it will be WDI themed.

When a user visits the site, they'll be greeted with a WDI pick me up that will hopefully cheer them up.

Create a basic Sinatra app inside your drills folder called pick_me_up Create your main.rb file and a views folder. In your views folder, you'll have a layout.erb file and a compliment.erb file.

@tealtail
tealtail / dbhelper
Last active December 25, 2015 03:19
Sinatra DB Helper module
helpers do
def db_exec(sql)
conn = PG.connect(:dbname =>'DB_NAME', :host => 'localhost')
result = conn.exec(sql)
conn.close
result
end
end
@tealtail
tealtail / Rakefile
Last active December 25, 2015 05:09 — forked from phlco/Rakefile
require 'git'
require 'date'
require 'logger'
START_DATE = Date.parse('23/09/2013')
namespace :hw do
desc "gets homework"
task :get do
Pushing to Heroku
-----------------
Install Heroku
Create an account on Heroku
Install the Heroku Toolbelt
$ heroku login
Enter your Heroku credentials.
@tealtail
tealtail / hangman.md
Last active December 27, 2015 04:49 — forked from phlco/hangman.md

Hangman LAB

###Goal:

  • The goal of this lab is to practice organizing your JavaScript code in an object-oriented way. It will also allow you to continue to practice working with events and manipulating the DOM.

The Hangman Game:

  • The game selects a random word from a list of words, and makes it the "secret word"
  • The number of letters in the secret word is obvious to the player, shown with a "_" displayed for each letter.
  • The player guesses one letter at a time, trying to figure out what the word is
  • If the player guesses correctly, any instances of that letter are revealed in the secret word.
@tealtail
tealtail / spec_helper.rb
Created November 18, 2013 20:22
spec_helper.rb
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'database_cleaner'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }