Skip to content

Instantly share code, notes, and snippets.

View skozz's full-sized avatar
🏠
Working from home

Angel skozz

🏠
Working from home
View GitHub Profile
@hatchan
hatchan / wercker.yaml
Created March 4, 2014 08:05
Example of the script step
build:
steps:
- script:
name: seed the database
code: rake db:seed
- script:
name: example multiple commands
code: |
export TEST_VAR=12345
cat $TEST > test.txt

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@imathis
imathis / gist:303650
Created February 13, 2010 19:58
linear-gradients.sass
// Sass:
+linear-gradient(colors(#ddd, #aaa)) //assumes "top"
+linear-gradient(colors(#ddd, #aaa), "left")
+linear-gradient(colors(#ddd, #aaa), "top left")
+linear-gradient(colors(#ddd, #aaa), "top right")
// Color stops - I'm using default vertical gradients for simplicity
+linear-gradient(colors(#ddd, #ccc, #aaa))
+linear-gradient(colors(#ddd, #ccc 20%, #aaa))
@fjaguero
fjaguero / svg-responsive.html
Last active December 13, 2015 16:58
HTML: SVG responsive images
<object data="http://www.website.com/responsive/img/logo.svg" type="image/svg+xml" class="logo">
<!--[if lte IE 8 ]-->
<img src="http://www.website.com/responsive/img/logo.gif" alt="Image Title">
<!--![endif]-->
</object>
<!-- Edit .svg file and erase width and height properties so it can automatically scale with viewport -->
<!--
CSS:
img, object {
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
#!/usr/bin/env ruby
require 'time'
require 'logger'
require 'aws-sdk'
AWS_REGION = "us-east-1"
AWS_KEY_ID = ""
AWS_SECRET_KEY = ""
@TylerRick
TylerRick / example.rb
Last active May 2, 2016 15:45
Allows you to define non-persisted attributes in an ActiveRecord model, the same way you can do in a regular ActiveModel model. This lets you use conveniences like my_method_changed? from ActiveModel::Dirty, for example, on your non-persisted attributes. Tested with Rails 3.2.11
# Example usage:
require 'active_record/nonpersisted_attribute_methods'
class Node < ActiveRecord::Base
include ActiveRecord::NonPersistedAttributeMethods
define_nonpersisted_attribute_methods [:bar]
# Example of using with ancestry and getting :parent to show up in changes hash.
has_ancestry
define_nonpersisted_attribute_methods [:parent]
@skozz
skozz / s3.sh
Created May 18, 2016 16:59 — forked from chrismdp/s3.sh
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
Geocoder.configure(:lookup => :test)
Geocoder::Lookup::Test.set_default_stub(
[
{
'latitude' => 40.7143528,
'longitude' => -74.0059731,
'address' => 'New York, NY, USA',
'state' => 'New York',
'state_code' => 'NY',
@billie66
billie66 / nginx.conf
Created September 11, 2012 06:49
Deploy Rails on Ubuntu server 12.04 with Nginx, Unicorn, Mongodb, Mongoid
# This file should be placed on the directory of ~/blog/config
upstream unicorn {
server unix:/tmp/unicorn.todo.socket fail_timeout=0;
}
server {
listen 80 default;
#server_name example.com;
root /home/username/blog/public;