Skip to content

Instantly share code, notes, and snippets.

View mrcljx's full-sized avatar

Marcel Jackwerth mrcljx

View GitHub Profile
@mrcljx
mrcljx / n2dissite.sh
Created May 21, 2012 19:17 — forked from hlfbt/n2dissite.sh
Nginx-to-ensite and Nginx-to-dissite - Two simple scripts that enable and disable Nginxs virtualhost VHOST. Adapt VHOSTEN and VHOSTAV accordingly, place in /usr/sbin and enjoy.
#!/bin/bash
# Author: Alexander Schulz
VHOSTEN="/etc/nginx/sites-enabled/"
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]
then
echo 'Usage: n2dissite VHOST'
echo 'Disables Nginxs virtualhost VHOST.'
@mrcljx
mrcljx / index.html
Created April 20, 2012 15:06
Intelligent iFrame
<iframe id="theGameFrame" src="about:blank" width="784" height="1000"></iframe>
<script type="text/javascript">
(function () {
"use strict";
var hash, match,
location = document.location.href,
theFrame = document.getElementById('theGameFrame');
def git_info
@@info ||= begin
{
:application => app_name = (Rails.application.class.to_s.split('::').first rescue ""),
:environment => Rails.env,
:remote_url => `git remote -v`,
:remote_branch => `git branch -r`,
:last_commit => `git log --max-count=1`
}
rescue
require 'aws/s3'
class StoredFile < ActiveRecord::Base
include AWS::S3
after_destroy :delete_on_s3!
validates_presence_of :filename, :size, :content_type
validates_numericality_of :size, :greater_than => 0
def extension