This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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/'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~$ FOO=$( echo "foo"; echo "bar" ) | |
| ~$ echo $FOO | |
| foo bar | |
| ~$ echo "$FOO" | |
| foo | |
| bar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| echo 'Enter blabla [Y/n]: '; | |
| $input = trim(fgets(STDIN)); | |
| $input = ($input === 'n') ? $input : 'Y'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Exercice | |
| def initialize | |
| @find = @do = 0 | |
| end | |
| def find (description) | |
| puts "# Find" if @find == 0 | |
| @find += 1 | |
| puts "## #{@find}: " + description | |
| yield |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Exercice = { | |
| find: function(description) { | |
| // do some stuff | |
| } | |
| } | |
| var exo = new Exercice(); | |
| var find = exo.find; | |
| find('blabla'); // actually calls exo.find() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def find (description) | |
| puts "Find: " + description | |
| yield | |
| puts "\n" | |
| end | |
| find "The Ruby API" do | |
| puts "http://ruby-doc.org/" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Tree | |
| attr_accessor :node_name, :children | |
| def initialize(name, children=[]) | |
| @node_name = name | |
| @children = children | |
| end | |
| def visit_all(&block) | |
| visit &block |