Skip to content

Instantly share code, notes, and snippets.

View ubermuda's full-sized avatar

Geoffrey Bachelet ubermuda

  • Paper Edu.
  • Granby, QC
View GitHub Profile
<?php
if($this -> Sandbox)
{
// Sandbox Credentials
$this -> ApplicationID = isset($DataArray['ApplicationID']) ? $DataArray['ApplicationID'] : '';
$this -> APIUsername = isset($DataArray['APIUsername']) && $DataArray['APIUsername'] != '' ? $DataArray['APIUsername'] : '';
$this -> APIPassword = isset($DataArray['APIPassword']) && $DataArray['APIPassword'] != '' ? $DataArray['APIPassword'] : '';
$this -> APISignature = isset($DataArray['APISignature']) && $DataArray['APISignature'] != '' ? $DataArray['APISignature'] : '';
$this -> EndPointURL = isset($DataArray['EndPointURL']) && $DataArray['EndPointURL'] != '' ? $DataArray['EndPointURL'] : 'https://svcs.sandbox.paypal.com/';
ash:tmp$ ls
foo somewhere_else
ash:tmp$ ls foo/
bar
ash:tmp$ pcopy foo
ash:tmp$ cd somewhere_else/
ash:somewhere_else$ ppaste
ash:somewhere_else$ ls
foo
ash:somewhere_else$ ls foo/
@ubermuda
ubermuda / sphinx-macosx.sh
Created June 6, 2012 02:05
Installing sphinxsearch on macosx
# first sphinx
brew install sphinx
# the formula does not install libsphinxclient :/
wget http://sphinxsearch.com/files/sphinx-2.0.4-release.tar.gz
tar xzf sphinx-2.0.4-release.tar.gz
cd sphinx-2.0.4-release/api/libsphinxclient/
CXXCPP="gcc -E" ./configure --prefix=/usr/local
make
make install
#!/usr/bin/env python
import sublime, sublime_plugin
import subprocess, os, socket, hashlib, signal, asyncore, asynchat, threading
# cccp stuff
class cccp_message:
def __init__(self, message, call_id):
message = '(:swank-rpc (swank:%s) %d)' % (message, call_id)
@ubermuda
ubermuda / gist:2002918
Created March 8, 2012 19:41
bash subshell and newlines
~$ FOO=$( echo "foo"; echo "bar" )
~$ echo $FOO
foo bar
~$ echo "$FOO"
foo
bar
<?php
echo 'Enter blabla [Y/n]: ';
$input = trim(fgets(STDIN));
$input = ($input === 'n') ? $input : 'Y';
class Exercice
def initialize
@find = @do = 0
end
def find (description)
puts "# Find" if @find == 0
@find += 1
puts "## #{@find}: " + description
yield
var Exercice = {
find: function(description) {
// do some stuff
}
}
var exo = new Exercice();
var find = exo.find;
find('blabla'); // actually calls exo.find()
def find (description)
puts "Find: " + description
yield
puts "\n"
end
find "The Ruby API" do
puts "http://ruby-doc.org/"
end
class Tree
attr_accessor :node_name, :children
def initialize(name, children=[])
@node_name = name
@children = children
end
def visit_all(&block)
visit &block