Skip to content

Instantly share code, notes, and snippets.

View anuragkapur's full-sized avatar

Anurag Kapur anuragkapur

View GitHub Profile
<filters>
<filter>env-config/${ENV}.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.yml</include>
</includes>
<build>
<plugins>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<configuration>
<appName>${APP_NAME}-${REGION}-${ENV}</appName>
</configuration>
</plugin>
source /Users/anuragkapur/tech-stuff/ak-skynet-env/scripts/git-completion.bash
@anuragkapur
anuragkapur / UsingBlocks.h
Last active August 29, 2015 14:05
Objective-C :: Blocks as Method Params
// Declaring a method that takes block parameters
+ (void)doWeHavePublishPermissionsForUserWithSuccessBlock:(void (^)(BOOL))successBlock
andFailureBlock:(void (^)(NSError *))failureBlock;
// Same as previous, but using a typdef for the block type for improved readability
typedef void (^ SuccessBlock)(BOOL);
typedef void (^ FailureBlock)(NSError *);
+ (void)doWeHavePublishPermissionsForUserWithSuccessBlock:(SuccessBlock)successBlock
andFailureBlock:(FailureBlock)failureBlock;
@Path("{path:.*}")
public class AccessResource {
private final Logger log = LoggerFactory.getLogger(AccessResource.class);
@GET
public Response checkAccessGet(@Context HttpServletRequest request) throws IOException {
logRequestInfo(request);
return checkAccess(request);
}
public class PlaygroundHttpClient {
private static final String X_FORWARDED_FOR = "X-Forwarded-For";
private void executeHttpGetOnDropwizardPlaygroundGreeting(String xForwardedFor, String name, String userAgent) {
URI uri = null;
try {
uri = new URIBuilder()
public class MyService extends Service<MyServiceConfiguration> {
@Override
public void initialize(Bootstrap<MyServiceConfiguration> bootstrap) {
bootstrap.setName("my-service");
}
@Override
public void run(AccessDropServiceConfiguration configuration, Environment environment) throws Exception {
environment.addResource(new AccessResource());
@anuragkapur
anuragkapur / .profile
Last active August 29, 2015 14:03
~/.profile
# .profile for anuragkapur on ak-skynet
# Maven
M2_HOME=/Users/anuragkapur/tech-stuff/tools/apache-maven/apache-maven-3.3.1
M2=$M2_HOME/bin
export PATH=$M2:$PATH
export M2_HOME=$M2_HOME
# Java
jdk7u65=/Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk/Contents/Home
# In a standard setup a remote called "heroku" points to your app. Remove this and setup two new "remotes" called "staging" and # "production".
$ git remote rm heroku
# point the remote named "staging" to the "staging" version of your app
$ git remote add staging git@heroku.com:wistreesolutions-staging.git
# point the remote named "production" to the "live" version of your app
$ git remote add production git@heroku.com:wistreesolutions.git
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>anurag-kapur</application>
<version>master</version>
<threadsafe>true</threadsafe>
</appengine-web-app>