Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dimiro1's full-sized avatar

Claudemiro A F Neto dimiro1

  • Berlin, Germany
View GitHub Profile

pyvenv-3.3 (Ubuntu 13.10, also Debian)

Symptoms

pyvenv-3.3 venvdir
venvdir/bin/python -c 'import sys; print(sys.path)'
# This should print the venvdir in sys.path.

But in buggy Ubuntu/Debian, it doesn't.

import javafx.scene.layout.StackPane;
import javafx.scene.web.WebView;
/**
* A syntax highlighting code editor for JavaFX created by wrapping a
* CodeMirror code editor in a WebView.
*
* See http://codemirror.net for more information on using the codemirror editor.
*/
public class CodeEditor extends StackPane {
@dimiro1
dimiro1 / passenger-management.rb
Created May 24, 2012 16:16 — forked from loopj/passenger-management.rb
Checks memory usage of all paseenger child process and kill if grows too large. Additionally kill off long running passengers to prevent memory leak issues (similar to the PassengerMaxRequests config variable in apache's passenger version, but works on bo
#!/usr/bin/env ruby
#
# Passenger management script
# By James Smith http://loopj.com
# Based heavily on a similar script by Jon Bettcher
#
# Check memory usage of all paseenger child process and kill if grows
# too large.
#
@dimiro1
dimiro1 / 1.8.7-p358-with-rogue-stdout-patch
Created May 12, 2012 12:25 — forked from kungfoo/1.8.7-p358-with-rogue-stdout-patch
Installing 1.8.7-p358 with rbenv, when glibc >= 2.14 is installed
build_package_stdout_patch() {
wget 'http://bugs.ruby-lang.org/attachments/download/1931/stdout-rouge-fix.patch'
patch -p1 < stdout-rouge-fix.patch
}
require_gcc
install_package "ruby-1.8.7-p358" "http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p358.tar.gz" stdout_patch standard
install_package "rubygems-1.6.2" "http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz" ruby
@dimiro1
dimiro1 / gist:2666262
Created May 12, 2012 12:22 — forked from amateurhuman/gist:2005745
Installing Rubinius 2.0.0-dev with rbenv

Installing rbx-2.0.0-dev with Ruby 1.9 support using rbenv can be a tad tricky. This is what I did to get up and running, you'll need another version of ruby already installed as well as rake.

The basic outline:

  1. Clone Rubinius HEAD from github
  2. Configure installation for rbenv and 1.9 support
  3. Install Rubinius
  4. Configure your $PATH to use Rubinius gems
  5. Start using Rubinius
@dimiro1
dimiro1 / Yield.php
Created March 7, 2012 14:32 — forked from eric1234/Yield.php
My implementation of Rail's layouts for Code Ignitor
<?php
// Based on http://codeigniter.com/forums/viewthread/57902/#284919
/**
* Yield
*
* Adds layout support :: Similar to RoR <%= yield =>
*
* Just output the variable $yield in your layout file which should
* be located in application/views/layouts/
class ErbEngine < Haml::Engine
def push_script(text, preserve_script, in_tag = false, preserve_tag = false,
escape_html = false, nuke_inner_whitespace = false)
push_text "<%= #{text.strip} %>"
end
def push_silent(text, can_suppress = false)
push_text "<% #{text.strip} %>"
end
end