Skip to content

Instantly share code, notes, and snippets.

recipes:
global:
- dotfiles::gitconfig
- applications::sass
- applications::ssh_config
- dotfiles::vim
- applications::composer
- applications::postgresql
- applications::mysql
- applications::php55
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / GmailHelper.java
Created January 27, 2016 12:37 — forked from nutanc/GmailHelper.java
Helper class for Gmail API to send and receive mails
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.auth.oauth2.TokenResponse;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl;
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.googleapis.auth.oauth2.GoogleTokenResponse;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpTransport;
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / gstorm_getter.groovy
Created January 27, 2016 10:46 — forked from kdabir/gstorm_getter.groovy
example of effect of getter in gstorm
@GrabResolver(name='gstorm', root='http://dl.bintray.com/kdabir/maven')
@Grab('io.github.kdabir.gstorm:gstorm:0.7')
@GrabConfig(systemClassLoader = true)
@Grab('org.hsqldb:hsqldb:2.3.2')
import groovy.sql.*
import gstorm.*
// using sql object explicitly to create Gstorm instance, this can be any other jdbc driver
def sql = Sql.newInstance("jdbc:hsqldb:mem:database1", "sa", "", "org.hsqldb.jdbcDriver")
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / Default (OSX).sublime-keymap
Created January 18, 2016 11:45 — forked from atuttle/Default (OSX).sublime-keymap
My Sublime Text 3 Preferences and Keymaps
[
{ "keys": ["alt+up"], "command": "swap_line_up" }
,{ "keys": ["alt+down"], "command": "swap_line_down" }
,{ "keys": ["ctrl+alt+down"], "command": "duplicate_line" }
,{ "keys": ["alt+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }
,{
"keys": ["ctrl+alt+left"],
"command": "set_layout",
"args": {
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / timezones.cfm
Created January 18, 2016 11:41 — forked from atuttle/timezones.cfm
Dealing with Time Zones in ColdFusion
<!---
Many thanks to Sean Corfield and Ryan Guill who set me down the correct path of java.util.TimeZone
--->
<cfscript>
writeDump(label="Conversion Examples",var={
"0-local-tz": getSystemTZ()
,"1-local-now": now()
,"2-utc-now": toUTC(now())
,"3-eastern-now": TZtoTZ( getSystemTZ(), now(), "America/New_York" )
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / jetty.groovy
Created January 18, 2016 10:17 — forked from akhikhl/jetty.groovy
groovy script for starting jetty server against the specified folder
@Grab('javax.servlet:javax.servlet-api:3.0.1')
@Grab(group='org.eclipse.jetty', module='jetty-webapp', version='8.1.8.v20121106')
@Grab(group='org.eclipse.jetty', module='jetty-server', version='8.1.8.v20121106', transitive=false)
@Grab(group='org.eclipse.jetty', module='jetty-servlet', version='8.1.8.v20121106', transitive=false)
@GrabExclude('org.eclipse.jetty.orbit:javax.servlet')
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.*
import groovy.servlet.*
// PostgreSQL
@GrabConfig(systemClassLoader=true)
@Grab('postgresql:postgresql:9.0-801.jdbc4')
def sql = groovy.sql.Sql.newInstance(
"jdbc:postgresql://host.example.org/database",
"username", "password", "org.postgresql.Driver")
// MySQL
@GrabConfig(systemClassLoader=true)

By now you've learned the basics of ColdFusion, script vs. tag syntax, scopes, how to deal with data, and even some code-reuse techniques. You're now able to write something useful, so it's time we introduce you to the Request Lifecycle.

You see, when someone requests a ColdFusion page, CF doesn't just start executing your code. There are several events that first take place, which you can be waiting for, and to which you can react. This is not strictly necessary, but you'll find that any complex application will eventually want to make use of some or all of these features, so it's best that you know about them. In order to react to these events, you need to have an Application.cfc file. ColdFusion has designated Application.cfc as a special component that it will automatically look for, and in which we can put our event listeners for request lifecycle events.

A Note on Terminolog
@LCHCAPITALHUMAIN
LCHCAPITALHUMAIN / open_app.html
Last active August 29, 2015 14:26 — forked from noelrocha/open_app.html
Open app on Google Play or AppStore
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Open App</title>
<!--
URL Params:
customSchemeURL: Your custom scheme app
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl
curl http://index.websolr.com/solr/a0b1c2d3/update -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'