Skip to content

Instantly share code, notes, and snippets.

🖥
C64/Amiga Scener/Coder

Uğur Özyılmazel vigo

🖥
C64/Amiga Scener/Coder
Block or report user

Report or block vigo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JosephPecoraro
JosephPecoraro / gist:4069
Created Aug 5, 2008
Shell Execution in Ruby
View gist:4069
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Returns the result of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@tritonrc
tritonrc / ldap_admin.rb
Created Jan 17, 2011
Simple Sinatra based LDAP admin tool
View ldap_admin.rb
require 'rubygems'
require 'sinatra'
require 'net-ldap'
require 'digest/sha1'
require 'base64'
require 'haml'
LDAP_HOST = 'localhost'
ADMIN_DN = 'cn=admin,dc=company,dc=com'
@shinzui
shinzui / tmux.conf
Created Mar 12, 2011 — forked from bryanl/tmux.conf
tmux.conf
View tmux.conf
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
@hughsaunders
hughsaunders / LDAPRemoteUserBackend.py
Created Jun 23, 2011
Django RemoteUserBackend for REMOTE_USER authentication and LDAP authorisation
View LDAPRemoteUserBackend.py
# LDAP Remote User Backend for Django 1.3
# Hugh Saunders - hugh@wherenow.org
# Written for the Surgical Materials Testing Laboratory - http://smtl.co.uk
# 2011
from django.contrib.auth.backends import RemoteUserBackend
import settings as s
import ldap
class LDAPRemoteUserBackend(RemoteUserBackend):
@michiel
michiel / cors-nginx.conf
Created Jul 5, 2011
Wide-open CORS config for nginx
View cors-nginx.conf
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@armonge
armonge / fields.py
Created Jul 18, 2011
A Django custom modelfield, formfield and formwidget to select and save a set of geographic coordinates using Google Maps
View fields.py
class GoogleMapMarker(object):
def __init__(self, latitude, longitude):
self.latitude = latitude
self.longitude = longitude
def __unicode__(self):
return '%f,%f'%(self.latitude, self.longitude)
def __len__(self):
return len(self.__unicode__())
@panthomakos
panthomakos / group.rb
Created Sep 20, 2011
Custom Error Messages in Ruby
View group.rb
class Group
module Error
class Standard < StandardError; end
class AlreadyAMember < Standard
def message
"You are already a member of this group."
end
end
@brentertz
brentertz / rvm2rbenv.txt
Created Nov 21, 2011
Switch from RVM to RBENV
View rvm2rbenv.txt
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@fairchild
fairchild / Gemfile
Created Dec 7, 2011
An example sinatra omniauth client app
View Gemfile
source :rubygems
gem 'sinatra'
gem 'json'
gem 'omniauth'
gem 'omniauth-oauth2'
gem 'omniauth-github'
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__)
gem 'thin'
@carljm
carljm / runner.py
Created Dec 9, 2011
Unittest2 test discovery and real dotted-path named test selection for Django
View runner.py
"""
An alternative Django ``TEST_RUNNER`` which uses unittest2 test discovery from
a base path specified in settings, rather than requiring all tests to be in
``tests`` module of an app.
If you just run ``./manage.py test``, it'll discover and run all tests
underneath the ``TEST_DISCOVERY_ROOT`` setting (a path). If you run
``./manage.py test full.dotted.path.to.test_module``, it'll run the tests in
that module (you can also pass multiple modules).
You can’t perform that action at this time.