Skip to content

Instantly share code, notes, and snippets.

View conradwt's full-sized avatar
🎯
Focusing

Conrad Taylor conradwt

🎯
Focusing
View GitHub Profile
#import <Firebase/Firebase.h>
#define kFirechatNS @"https://<your-firebase>.firebaseio.com/"
@interface SomethingViewController ()
@property (nonatomic, strong) Firebase* firebase;
- (void)startFirebaseEvents;
- (void)enterChannel;
#define kFirechatNS @"https://<your-firebase-subdomain>.firebaseio.com/"
- (void)addUser:(NSString *)aUser toChannel:(NSString *)aChannel
{
Firebase * currentUserReference = [self.firebase childByAutoId];
NSString * path = [NSString stringWithFormat:@"matches/channels/%@/users/%@/", aChannel, [currentUserReference name]];
[[self.firebase childByAppendingPath:path] setValue: @{ @"user_id" : aUser,
@"firebase_id" : [currentUserReference name],
@conradwt
conradwt / gist:04673b81ffffefd88dbb
Created July 31, 2014 09:45
certificate verify failed
$ rails new fashionfreelance -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb
Using from /Users/conradwt/.railsrc
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/javascripts/application.js
@conradwt
conradwt / learningchef-week-4
Last active August 29, 2015 14:05
learningchef-week-4
$ knife bootstrap URL -x root -P Password -N module3 -r "recipe[apache]"
Connecting to uvo1ilefd4schorqxfc.vm.cld.sr
uvo1ilefd4schorqxfc.vm.cld.sr Starting first Chef Client run...
uvo1ilefd4schorqxfc.vm.cld.sr [2014-08-11T15:52:48-04:00] WARN:
uvo1ilefd4schorqxfc.vm.cld.sr * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
uvo1ilefd4schorqxfc.vm.cld.sr SSL validation of HTTPS requests is disabled. HTTPS connections are still
uvo1ilefd4schorqxfc.vm.cld.sr encrypted, but chef is not able to detect forged replies or man in the middle
uvo1ilefd4schorqxfc.vm.cld.sr attacks.
uvo1ilefd4schorqxfc.vm.cld.sr
uvo1ilefd4schorqxfc.vm.cld.sr To fix this issue add an entry like this to your configuration file:
@conradwt
conradwt / hello_world_with_vim.rb
Created May 16, 2015 19:50
Checkpoint [6]: Sublime Text Assignment
[11:32] [~] $ vim hello_world_with_vim.rb
[12:42] [~] $ cat hello_world_with_vim.rb
def hello_world
puts "hello world, vim is cool!"
end
@conradwt
conradwt / gist:5f6ca01c5a373222c032
Created June 9, 2015 17:53
Blocmetrics Checkpoint [6]: Info. Curl Response
$ curl -v -H "Accept: application/json" -H "Origin: http://registered_application.com" -H "Content-Type: application/json" -X POST -d '{"name":"foobar"}' http://localhost:3000/api/events
* Trying ::1...
* Connected to localhost (::1) port 3000 (#0)
> POST /api/events HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.42.1
> Accept: application/json
> Origin: http://registered_application.com
> Content-Type: application/json
> Content-Length: 17
$ nm /opt/local/lib/libiconv.dylib | grep iconv_open
0000000000017f30 T _libiconv_open
0000000000018a60 T _libiconv_open_into
$ file /opt/local/lib/libiconv.dylib
/opt/local/lib/libiconv.dylib: Mach-O 64-bit dynamically linked shared library x86_64
$ nm /usr/lib/libiconv.dylib | grep iconv_open
000150b5 T _iconv_open
000158cc T _libiconv_open
@conradwt
conradwt / gist:257344
Created December 15, 2009 21:55
libiconv verification
$ ls -al /opt/local/lib/libiconv.dylib
lrw-r--r-- 1 root admin 16 Nov 11 08:54 /opt/local/lib/libiconv.dylib -> libiconv.2.dylib
$ which iconv
/opt/local/bin/iconv
$ iconv --version
iconv (GNU libiconv 1.13)
Copyright (C) 2000-2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
irb(main):001:0> FFI::DEBUG = 10
=> 10
irb(main):002:0> require 'iconv'
RpWarning: parenthesize argument(s) for future version
RpWarning: parenthesize argument(s) for future version
--FFI: ffi_lib: adding
--FFI: ffi_lib: adding libiconv
--FFI: attach_function: iconv_open searching process
--FFI: attach_function: iconv_open searching lib libiconv
error , Unable to find FFI 'iconv_open' in: ,
$ ant clean build-all
Buildfile: build.xml
BUILD FAILED
/Users/conradwt/clojure.dir/projects/enclojure/build.xml:2: Problem: failed to create task or type antlib:org.apache.ivy.ant:settings
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet