Skip to content

Instantly share code, notes, and snippets.

View aoberoi's full-sized avatar
👷‍♂️
Under construction

Ankur Oberoi aoberoi

👷‍♂️
Under construction
View GitHub Profile
def create
super do |resource|
# my own work
end
end
@aoberoi
aoberoi / CustomVideoCapturer.java
Created June 10, 2014 18:58
Android Custom Video Capturer
package com.opentok.android.demo.video;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
import android.content.Context;
import android.graphics.ImageFormat;
import android.graphics.PixelFormat;
import android.graphics.SurfaceTexture;
import android.hardware.Camera;
@aoberoi
aoberoi / ExampleViewController.m
Last active August 29, 2015 14:01
Combat logging
#import "ExampleViewController.h"
//
// 1. Forward declaration for OTCombatLogger
//
@interface OpenTokObjC : NSObject
+ (void)setLogBlockQueue:(dispatch_queue_t)queue;
+ (void)setLogBlock:(void (^)(NSString* message, void* arg))logBlock;
@end

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

Giselle:play ankur$ mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
---------------------------------------------------
constituent[0]: file:/usr/local/Cellar/maven/3.2.1/libexec/lib/aether-api-0.9.0.M2.jar
constituent[1]: file:/usr/local/Cellar/maven/3.2.1/libexec/lib/aether-connector-wagon-0.9.0.M2.jar
constituent[2]: file:/usr/local/Cellar/maven/3.2.1/libexec/lib/aether-impl-0.9.0.M2.jar
constituent[3]: file:/usr/local/Cellar/maven/3.2.1/libexec/lib/aether-spi-0.9.0.M2.jar
constituent[4]: file:/usr/local/Cellar/maven/3.2.1/libexec/lib/aether-util-0.9.0.M2.jar
constituent[5]: file:/usr/local/Cellar/maven/3.2.1/libexec/lib/aopalliance-1.0.jar
constituent[6]: file:/usr/local/Cellar/maven/3.2.1/libexec/lib/cdi-api-1.0.jar
constituent[7]: file:/usr/local/Cellar/maven/3.2.1/libexec/lib/commons-cli-1.2.jar
@aoberoi
aoberoi / callback-foo.js
Created March 20, 2014 15:27
i've got it!
it('complains when the p2p or location values are not valid', function(done) {
var self = this;
// YAY higher order programming :)
var expectError = function(cb) {
return function(err, result) {
expect(err).to.be.an.instanceof(Error);
cb(null)
};
};
async.parallel([
curl 'http://anvil.opentok.com/session/1_MX44NTQ1MTF-MTIuMzQuNTYuNzh-V2VkIE1hciAxOSAyMTozNDo0OSBQRFQgMjAxNH4wLjMwMjU3OTY0fg?extended=true' -X OPTIONS -H 'Access-Control-Request-Method: GET' -H 'Origin: http://client.cors-api.appspot.com' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36' -H 'Accept: */*' -H 'Referer: http://client.cors-api.appspot.com/client' -H 'Connection: keep-alive' -H 'Access-Control-Request-Headers: x-tb-token-auth' --compressed --verbose
@aoberoi
aoberoi / car.rb
Created March 15, 2014 15:44
testing isn't always obvious. sugary syntaxes make me less confident in the test than the code its testing.
class Car
def initialize(make, model, color="black")
@make = make
@model = model
@color = color
end
end
//... imports and pacakge declarations
public class SomeActivity extends Activity implements Session.Listener {
Session mSession;
ViewGroup mPublisherViewContainer;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.some_activity);
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
2 info using [email protected]
3 info using [email protected]
4 verbose read json /Users/ankur/Developer/nko4-website/package.json
5 info shrinkwrap file "/Users/ankur/Developer/nko4-website/npm-shrinkwrap.json"
6 verbose readDependencies returned deps { async: 'https://registry.npmjs.org/async/-/async-0.2.9.tgz',
6 verbose readDependencies returned deps 'coffee-script': 'https://registry.npmjs.org/coffee-script/-/coffee-script-1.6.3.tgz',
6 verbose readDependencies returned deps colors: 'https://registry.npmjs.org/colors/-/colors-0.6.2.tgz',
6 verbose readDependencies returned deps 'connect-assetmanager': '0.0.28',