Skip to content

Instantly share code, notes, and snippets.

View tomciopp's full-sized avatar

Thomas Cioppettini tomciopp

View GitHub Profile
@tomciopp
tomciopp / appointment.rb
Created June 21, 2012 03:15
Modeling a reservation system
belongs_to :reservation
belongs_to :user
attr_accessible :reservation_id, :user_id
@tomciopp
tomciopp / application.rb
Created August 31, 2012 00:58
Setting up Postgis with Postgresql
require 'rails/all'
require 'squeel'
require 'active_record/connection_adapters/postgis_adapter/railtie'
require("web/static/js/logging.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
});
;require.register("web/static/js/logging.js", function(exports, require, module) {
"use strict";
console.log("Logs to the console");
});
@tomciopp
tomciopp / gist:1805852
Created February 12, 2012 02:25
Sinatra contact form
-------------------------------
The code for the contact form
-------------------------------
<div id='contact-box' class="group">
<div class="span6 clear">
<form action="/" method="post" class="well">
<label for="name">Your Name:</label>
<input type="text" name="name" class="span4" placeholder="John Smith...">
<label for="email">Your email address:</label>
This file has been truncated, but you can view the full file.
12006 silly decomposeActions build core-util-is@https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz
12007 silly decomposeActions install core-util-is@https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz
12008 silly decomposeActions postinstall core-util-is@https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz
12009 silly decomposeActions finalize core-util-is@https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz
12010 silly decomposeActions refresh-package-json core-util-is@https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz
12011 silly decomposeActions fetch create-ecdh@https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz
12012 silly decomposeActions extract create-ecdh@https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz
12013 silly decomposeActions preinstall create-ecdh@https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz
12014 silly decomposeActions build create-ecdh@https://registry.npmjs.org/create-ecdh/-/create-e
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.1.0_1/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install' ]
2 info using npm@5.0.3
3 info using node@v8.1.0
4 verbose npm-session 6ff218f68cdf657a
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall assets
7 info lifecycle @~preinstall: @
@tomciopp
tomciopp / colors.scss
Created January 15, 2018 01:09
Using a color palette
$palettes: (
black: (
lightest: hsl(0, 0%, 40%),
lighter: hsl(0, 0%, 35%),
light: hsl(0, 0%, 30%),
base: hsl(0, 0%, 25%),
dark: hsl(0, 0%, 20%),
darker: hsl(0, 0%, 15%),
darkest: hsl(0, 0%, 10%)
),
@tomciopp
tomciopp / registrations_controller.rb
Created May 31, 2012 23:43
Using devise with wicked for sign up wizards
class RegistrationsController < Devise::RegistrationsController
def create
build_resource
if resource.save
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_navigational_format?
sign_in(resource_name, resource)
respond_with resource, :location => after_sign_up_path_for(resource)
$palettes: (
"blue": (
lightest: hsl(201, 87%, 72%),
lighter: hsl(201, 81%, 65%),
light: hsl(201, 77%, 58%),
base: hsl(201, 75%, 51%),
dark: hsl(201, 77%, 46%),
darker: hsl(201, 81%, 41%),
darkest: hsl(201, 87%, 36%)
),
@tomciopp
tomciopp / README.txt
Created November 25, 2018 17:47
Pure Elixir/Erlang CRC32C implementations
I have tested the elixir version and it works, but have not tested the erlang version of this code.