Skip to content

Instantly share code, notes, and snippets.

View joemocha's full-sized avatar
🎯
Focusing

joemocha

🎯
Focusing
View GitHub Profile
# The GraphicsMagick action, dependent on the `gm` command, is able to perform
# any number of GraphicsMagick conversions on an image passed in as an input.
# The options hash should specify the +name+ for the particular step (which is
# appended to the resulting image filename) the +command+ (eg. convert, mogrify),
# the +options+ (to the command, eg. -shadow -blur), and the +extension+ which
# will determine the resulting image type. Optionally, you may also specify
# +input+ as the name of a previous step; doing this will use the result of
# that step as the source image, otherwise each step uses the original image
# as its source.
class GraphicsMagick < CloudCrowd::Action
@joemocha
joemocha / Gemfile
Created February 19, 2010 20:55
interesting setup
# encoding: utf-8
source :gemcutter
source 'http://gems.github.com'
# Rails 2.x style.
group :rails do
gem 'rails', '~> 2.3.5', :require => nil
gem 'builder', '~> 2.1.2'
gem 'memcache-client', '>= 1.7.4', :require => nil
gem 'tzinfo', '~> 0.3.12'
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
DB = {
:redis => SITE_REDIS,
:geo => GEO
}
SITES = DB[:redis].smembers("sites").inject({}) do |sum, site|
sum[site] = JSON.parse(DB[:redis]["site:#{site}"])
sum
end
module FCG
module Client
module Comment
# sort attributes
ATTRIBUTES = [:site, :record, :body, :body_as_html, :deleted, :flagged_by, :depth, :path, :parent_id, :displayed_name, :user_id]
module ClassMethods
end
module FCG
module Rest
attr_accessor :model
module ClassMethods
def restful(*args)
options = args.extract_options!
opts = {
:only => [:get, :post, :put, :delete],
:search => false
}.merge(options)
# require 'rake'
# require 'bundler'
# Bundler::GemHelper.install_tasks
dir = File.dirname(File.expand_path(__FILE__))
# $LOAD_PATH.unshift dir + '/lib/fcg-service-servers'
require 'lib/fcg-service-servers/version'
require 'rspec/core/rake_task'
#! /bin/sh
# Run this from the folder you want to be the parent of your docs
# By default, generated docs go into
# titanium_mobile/dist/apidoc/ti_mobile_docs/
#
# This can be changed below
git clone https://github.com/appcelerator/titanium_mobile.git
cd titanium_mobile
sudo apt-get install python-setuptools python-dev
@joemocha
joemocha / cors.nginxconf
Created November 2, 2015 17:42 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {
@joemocha
joemocha / index.md
Created September 22, 2016 13:04 — forked from alekseykulikov/index.md
SUIT CSS naming convention for React.js application

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 6561 lines of CSS (and just 5 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers: