Skip to content

Instantly share code, notes, and snippets.

View dreamstarter's full-sized avatar
💭
Building a new application!

Bryan Anderson dreamstarter

💭
Building a new application!
View GitHub Profile
@dreamstarter
dreamstarter / .gitconfig
Created February 28, 2019 18:26 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
@dreamstarter
dreamstarter / Rakefile
Created September 27, 2018 13:02 — forked from brettchalupa/Rakefile
Testing Rake tasks with RSpec examples from the talk I gave at Test Ruby PDX in March 2016. See more here: http://bit.ly/testing-rake-tasks
require_relative 'greeter'
desc 'Outputs a greeting to stdout'
task :hello do
Greeter.new.greet
end
@dreamstarter
dreamstarter / bar.rake
Created September 27, 2018 12:57
Testing rake tasks
File: lib/tasks/bar.rake
class BarOutput
def self.banner text
puts '*' * 60
puts " #{text}"
puts '*' * 60
end
def self.puts string
puts string
@dreamstarter
dreamstarter / app.rake
Created September 25, 2018 15:12 — forked from ChuckJHardy/app.rake
Rake Task for Database Population
------------ From Rake Task
namespace :app do
# Checks and ensures task is not run in production.
task :ensure_development_environment => :environment do
if Rails.env.production?
raise "\nI'm sorry, I can't do that.\n(You're asking me to drop your production database.)"
end
end
@dreamstarter
dreamstarter / Coldfusion - simple login script
Last active September 25, 2018 15:09
Simple login script
<cfif session.login_required EQ "Y">
<cfif NOT findnocase('login.cfm',CGI.SCRIPT_NAME) AND session.loggedin EQ "n">
<cfscript>
structDelete(session, 'user');
structDelete(session, 'admin');
</cfscript>
<cflocation url="#this.site_root#/login.cfm" addtoken="no">
</cfif>
<cfif checklogin EQ "y">
<!--- invoke the users controller and check the form data submitted from the login form --->
@dreamstarter
dreamstarter / Javascript - Simple email validation
Last active March 27, 2024 16:24
Javascript - Use a regex to check the email address input.
function checkEmail(email) {
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if (!reg.test(email)) return false;
return true;
}