Skip to content

Instantly share code, notes, and snippets.

View cenan's full-sized avatar
👻
dead

cenan ozen cenan

👻
dead
View GitHub Profile
@jbonney
jbonney / deploy.rb
Created August 17, 2013 15:15
Mina deployment file to setup new host for Rails applications. Creates the folder structure, fill up the database.yml file, create the associated DB and user and set up new Apache virtual host file.
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
# Usually mina focuses on deploying to one host and the deploy options are therefore simple.
# In our case, there is a number of possible servers to deploy to, it is therefore necessary to
# specify the host that we are targeting.
server = ENV['server']
# Since the same host can have multiple applications running in parallel, it is necessary to
@jordic
jordic / ssh.go
Created May 27, 2014 14:03
golang mysql throught a tunnel
package main
// based on gist
// https://gist.github.com/ir4y/11146415
// http://stackoverflow.com/questions/21417223/simple-ssh-port-forward-in-golang
// obro conexio ssh amb el server remot.
// tot el que envio al port local ho copio al port remote
// a traves de la conexio remota. Per tant he d'obrir un
// port a la maquina remota?
@seanlilmateus
seanlilmateus / gist:3187192
Last active March 5, 2021 07:17
How to use Obj-C with MacRuby/Rubymotion

Using Obj-C with MacRuby/Rubymotion

This little post aims to help you to translate Objective-C Blocks into Ruby blocks. Let's start by taking a look at few examples of iOS API call where blocks are used for animations and enumeration

Ruby Lambda Syntaxes:

Im Rubymotion and MacRuby you can use all the Ruby Lambda syntaxes that are:

block = lambda { |param|  ... }
@pixleight
pixleight / dabblet.css
Created May 7, 2012 18:17
CSS-Only Pinterest-style box columns
/**
* CSS-Only Pinterest-style box columns
*/
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300);
html {
background: #DEF;
background: linear-gradient(45deg, #FFE, #FED);
@kei2100
kei2100 / ImageMagick and JMagick install on Mac OSX
Last active November 6, 2019 15:40
ImageMagick and JMagick install on Mac OSX
# imagemagick
brew install imagemagick --disable-openmp
すると色々怒られるので、
sudo brew link libtiff
sudo brew link little-cms
sudo brew link jasper
sudo brew link imagemagick
sudo brew link jpeg
する
@AhmedElSharkasy
AhmedElSharkasy / best_practices
Last active April 8, 2019 14:53
Rails 3 AntiPatterns, Useful snippets and Recommended Refactoring. Note: Some of them are collected from different online resources/posts/blogs with some tweaks.
Rails as it has never been before :)
Rails 3 AntiPatterns, Useful snippets and Recommended Refactoring.
Note: Some of them are collected from different online resources/posts/blogs with some tweaks.
@justinvoss
justinvoss / fabfile.py
Created June 20, 2011 16:05
Example Fabric and Cuisine Scrips
from deployment.cuisine import *
from fabric.api import *
from fabric.context_managers import *
from fabric.utils import puts
from fabric.colors import red, green
import simplejson
import os
@rayfranco
rayfranco / GravatarExtension.php
Last active November 6, 2018 05:30
Twig extension filter that convert email into gravatar url, or secure gravatar url
<?php
// Acme\DemoBundle\Twig\GravatarExtension
namespace Acme\DemoBundle\Twig;
class GravatarExtension extends \Twig_Extension
{
private $secure_request = false;
#!/usr/bin/env ruby
require 'base64'
require 'open-uri'
# file or url
def get_css(src)
if src.start_with? 'http'
src = src.gsub('|', '%7C')
STDERR.puts "# GET #{src}"
# simulate modern browser to get woff
@bondario
bondario / ubuntu1204_php54
Created August 9, 2013 15:54
Downgrade php 5.5 to 5.4 or keep php 5.4 for Ubuntu 12.04.02 LTS
apt-get install -y ppa-purge
add-apt-repository -y ppa:ondrej/php5-oldstable
apt-get update
ppa-purge ppa:ondrej/php5
apt-get update && apt-get upgrade -y && apt-get autoremove -y && apt-get autoclean -y