This file contains 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
require 'uservoice-ruby' | |
SUBDOMAIN_NAME = 'your_subdomain' | |
API_KEY = 'your_key' | |
API_SECRET = 'your_secret' | |
URL = 'http://localhost:3000/' | |
client = UserVoice::Client.new(SUBDOMAIN_NAME, API_KEY, API_SECRET, :callback => URL) | |
user = '[email protected]' | |
forum_id = 12345 |
This file contains 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
<? | |
// Your account info | |
$USERVOICE_SUBDOMAIN = 'your_subdomain'; | |
$API_KEY = 'your_key'; | |
$API_SECRET = 'your_secret'; | |
// Info about the suggestion and user | |
$user = '[email protected]'; | |
$forum_id = 1234; |
This file contains 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 | |
$USERVOICE_SUBDOMAIN = '**SCRUBED**'; | |
$SSO_KEY = '**SCRUBED**'; | |
$API_KEY = '**SCRUBED**'; | |
$API_SECRET = '**SCRUBED**'; | |
// Use autoload.php of Composer to use the library and its dependencies: | |
require_once 'vendor/autoload.php'; |
This file contains 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
1.9.3p286 :001 > a = Hash.new([]) | |
=> {} | |
1.9.3p286 :002 > a[:foo] << 1 | |
=> [1] | |
1.9.3p286 :003 > a[:bar] << 1 | |
=> [1, 1] | |
1.9.3p286 :004 > b = Hash.new(){[]} | |
=> {} | |
1.9.3p286 :005 > b[:foo] << 1 | |
=> [1] |
This file contains 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
# my machine | |
> curl https://secure.braintreepaymentgateway.com/api/query.php | |
> <?xml version="1.0" encoding="UTF-8"?>... | |
# web60 | |
> curl https://secure.braintreepaymentgateway.com/api/query.php | |
> <?xml version="1.0" encoding="UTF-8"?>... | |
# chrome (requesting url manually) | |
<?xml version="1.0" encoding="UTF-8"?>... |
This file contains 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
<script src='/sample.js'></script> | |
<script> | |
window.my_func('hello, world!'); | |
</script> |
This file contains 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
tyler@~/dev/work/uservoice> cap deploy production:rollback | |
triggering start callbacks for `deploy' | |
* == Currently executing `multistage:ensure' | |
*** Defaulting to `staging' | |
* == Currently executing `staging' | |
* == Currently executing `deploy' |
This file contains 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
"xxxxxxxx".force_encoding('utf-8') == "xxxxxxxx".force_encoding('ASCII-8BIT') #=> true | |
"\xc3\xa9".force_encoding('utf-8') == "\xc3\xa9".force_encoding('ASCII-8BIT') #=> false | |
"\xc3\xa9".force_encoding('utf-8') == "\xc3\xa9".force_encoding('utf-8') #=> true |
This file contains 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
int | |
rb_str_cmp(VALUE str1, VALUE str2) | |
{ | |
long len1, len2; | |
const char *ptr1, *ptr2; | |
int retval; | |
if (str1 == str2) return 0; | |
RSTRING_GETMEM(str1, ptr1, len1); | |
RSTRING_GETMEM(str2, ptr2, len2); |
This file contains 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
1.9.3p286 :005 > a = 'a' | |
=> "a" | |
1.9.3p286 :006 > b = [a.method(:to_i), a.method(:upcase)] | |
=> [#<Method: String#to_i>, #<Method: String#upcase>] | |
1.9.3p286 :007 > b[1].call | |
=> "A" |