Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Petruzzi rip747

View GitHub Profile
@rip747
rip747 / Rails Setup.txt
Created Oct 17, 2020 — forked from Deanout/Rails Setup.txt
Ruby on Rails 6 Setup Ubuntu 18.04
View Rails Setup.txt
Commands from http://howtoforge.com/tutorial/ubuntu-ruby-on-rails
Yarn from https://linuxize.com/post/how-to-install-yarn-on-ubuntu-18-04/
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable --ruby
Restart terminal
@rip747
rip747 / Other resources
Last active Mar 16, 2019
Rails on Windows: My Notes
View Other resources
Multiple Databases with Rails
https://www.thegreatcodeadventure.com/managing-multiple-databases-in-a-single-rails-application/
Using GUID's As Primary Keys
https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-GUID's-As-Primary-Keys
@rip747
rip747 / web.config
Created Mar 16, 2019
web.config file for Rails on IIS
View web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add
name="httpplatformhandler"
path="*"
verb="*"
modules="httpPlatformHandler"
resourceType="Unspecified"
@rip747
rip747 / Files uploaded
Last active Aug 29, 2015
CFML Rack Middleware idea for returning a list of uploaded files
View Files uploaded
<cfscript>
// credit to David "MisterDai" Boyer
// http://misterdai.yougeezer.co.uk/posts/2012/03/08/coldfusion-10-beta-multiple-html5-multiple-uploads-bug/
if (cgi.request_method == 'POST') {
WriteDump(var = form, label = "Form Scope");
for (field in form) {
form[field] = ListToArray(form[field]);
}
WriteDump(var = form, label = "Form Scope - Parsed");
@rip747
rip747 / gist:5888011
Created Jun 28, 2013
modified to youtube.cfc for 2.1
View gist:5888011
<cfcomponent displayName="YouTube CFC" output="false">
<cfset variables.authtoken="">
<cfset variables.username="default">
<cfset variables.devkey="">
<cfset variables.standardurl = "http://gdata.youtube.com/feeds/api/standardfeeds/">
<cffunction name="init" access="public" returnType="youtube" output="false">
<cfargument name="devkey" type="string" required="true">
@rip747
rip747 / SublimeText
Created Jun 6, 2012
SublimeText keyboard mapping
View SublimeText
[
/* erb temnplate plugin */
{ "keys": ["ctrl+shift+z"], "command": "erb" },
/* the mac keyboard layout SUCKS! Make it like windows */
{ "keys": ["ctrl+left"], "command": "move", "args": {"by": "words", "forward": false} },
{ "keys": ["ctrl+right"], "command": "move", "args": {"by": "words", "forward": true} },
{ "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} },
{ "keys": ["ctrl+shift+right"], "command": "move", "args": {"by": "words", "forward": true, "extend": true} },
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol", "extend": false} },
@rip747
rip747 / gist:2853902
Created Jun 1, 2012
implementing a CFWheels service layer
View gist:2853902
<!--- add the following to the events/onapplicationstart.cfm --->
<cffunction name="initServices" returntype="void" hint="I initialize the services objects for this app">
<cfset var loc = {}>
<cfset application.$_ServiceObjects = {}>
<cfdirectory action="list" directory="#expandPath('services')#" name="loc.services"/>
<cfloop query="loc.services">
<cfset application.$_ServiceObjects[ListFirst(name, '.')] = createObject("component", "services.#ListFirst(name, '.')#").init()>
</cfloop>
</cffunction>
<cfset initServices()>
@rip747
rip747 / gist:1116619
Created Jul 31, 2011
cfwheels api doc generation... idea
View gist:1116619
<cfcomponent extends="Controller">
<cffunction name="index">
<cfsetting showdebugoutput="false">
<cfset releasesDir ="#get('rootpath')##get('filePath')#/releases">
<cfdirectory action="list" directory="#expandPath(releasesDir)#" filter="*.zip" name="releases">
@rip747
rip747 / wheels tabless model
Created May 19, 2011
wheels tableless model
View wheels tabless model
diff --git a/wheels/model/initialization.cfm b/wheels/model/initialization.cfm
index 3755c2c..24a6c94 100644
--- a/wheels/model/initialization.cfm
+++ b/wheels/model/initialization.cfm
@@ -45,140 +45,144 @@
// run developer's init method if it exists
if (StructKeyExists(variables, "init"))
init();
-
- // make sure that the tablename has the respected prefix
View cfmiddleware
<cfcomponent>
<cfset $class = {}>
<cffunction name="init">
<cfargument name="relativePath" type="string" default="" hint="the relative component path from the webroot">
<cfset $class.container = []>
<cfset $class.relativePath = arguments.relativePath>
</cffunction>