Skip to content

Instantly share code, notes, and snippets.

View VladoMS's full-sized avatar

Vladislav Stoyanov VladoMS

View GitHub Profile
@njvitto
njvitto / deploy.rake
Created April 11, 2010 16:56 — forked from RSpace/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@nicoulaj
nicoulaj / build-zsh.sh
Created November 25, 2010 20:19
Build Zsh from sources on Ubuntu
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
cd zsh
@scottwb
scottwb / nginx_subdomain.conf
Created January 25, 2011 16:38
Nginx config to route domain and subdomains, except for explicit virtual hosts, to the www subdomain.
http {
# Default virtual host for www.example.com. This will pick up all HTTP
# requests to port 80 that are not for one of the other virtual hosts.
server {
listen 80;
server_name www.example.com;
# ...your server config here...
@jgv
jgv / gist:1502777
Created December 20, 2011 19:03 — forked from trevorturk/gist:34895
Allow "uploads via url" with Rails and Paperclip
#
# See also: http://almosteffortless.com/2008/12/11/easy-upload-via-url-with-paperclip/
#
# Allow "uploads via url" with Rails and Paperclip
#
# http://www.thoughtbot.com/projects/paperclip
# http://github.com/thoughtbot/paperclip/tree/master
# http://groups.google.com/group/paperclip-plugin/browse_thread/thread/456401eb93135095
#
# This example is designed to work with a "Photo" model that has an "Image" attachment
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@ZipoKing
ZipoKing / symfony2_nginx.conf
Created May 3, 2012 09:32
Sample nginx configuration for Symfony2
server {
listen 80;
server_name symfony2;
root /var/www/symfony2/web;
error_log /var/log/nginx/symfony2.error.log;
access_log /var/log/nginx/symfony2.access.log;
# strip app.php/ prefix if it is present
@antoinemartin
antoinemartin / fcgi.py
Created June 27, 2012 13:49
Django management command to run Django on Windows with IIS through FastCGI
# encoding: utf-8
# FastCGI-to-WSGI bridge for files/pipes transport (not socket)
#
# Copyright (c) 2002, 2003, 2005, 2006 Allan Saddi <allan@saddi.com>
# Copyright (c) 2011 Ruslan Keba <ruslan@helicontech.com>
# Copyright (c) 2012 Antoine Martin <antoine@openance.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@sgmurphy
sgmurphy / url_slug.php
Created July 12, 2012 15:52
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@psykzz
psykzz / downloader.class.php
Created September 9, 2012 21:51
Simple rate limited downloader.
<?php
/* *
* @filename downloader.class.php
* @author PsyKzz
* @version 1.0.0
* @description Simple class to rate limit your downloads, while also providing a custom tickrate to combat timeout issues.
* @url http://www.psykzz.co.uk
*
* @license 'WTFPL ' - "Do What The Fuck You Want To Public License".
* This program is free software. It comes without any warranty, to
@chrisjensenuk
chrisjensenuk / JsMinifyCodeSettings.cs
Created October 16, 2012 16:18
Preserve important comments in javascript files when using ASP.NET MVC 4 Bundles
using System;
using System.Web;
using System.Web.Optimization;
using System.Collections;
using Microsoft.Ajax.Utilities;
using System.Collections.Generic;
using System.Text;
//example bundle configuration
public class BundleConfig