Skip to content

Instantly share code, notes, and snippets.

View infynyxx's full-sized avatar
🫐

Prajwal Tuladhar infynyxx

🫐
View GitHub Profile
@infynyxx
infynyxx / keybase.md
Last active August 29, 2015 14:01
keybase.md

Keybase proof

I hereby claim:

  • I am infynyxx on github.
  • I am infynyxx (https://keybase.io/infynyxx) on keybase.
  • I have a public key whose fingerprint is 2412 890D 9A30 54A3 FC09 D548 46D5 20DF F3AF 4F92

To claim this, I am signing this object:

@infynyxx
infynyxx / suppressions.xml
Created April 3, 2013 17:29
suppressions.xml
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<!-- Suppress JavadocPackage in the test packages -->
<suppress checks="JavadocPackage" files="[\\/]test[\\/]"/>
</suppressions>
@infynyxx
infynyxx / build.txt
Last active December 15, 2015 10:49
Netty build error: $ java -version Picked up _JAVA_OPTIONS: -Xmx1g java version "1.7.0_11" Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.035 sec <<< FAILURE!
io.netty.verify.osgi.BasicFrameworkIT Time elapsed: 2.024 sec <<< ERROR!
org.ops4j.pax.exam.TestContainerException: Problem starting test container.
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:947)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
object NettyFutureBridge {
import scala.concurrent.{ Promise, Future }
import scala.util.Try
import java.util.concurrent.CancellationException
import org.jboss.netty.channel.{ Channel, ChannelFuture, ChannelFutureListener }
def apply(nettyFuture: ChannelFuture): Future[Channel] = {
val p = Promise[Channel]()
nettyFuture.addListener(new ChannelFutureListener {
def operationComplete(future: ChannelFuture): Unit = p complete Try(
@infynyxx
infynyxx / EventActor.scala
Created August 8, 2012 06:27
Scala Evented Actors
import scala.actors.Actor
import Actor._
def buildChain(size: Int, next: Actor): Actor = {
val a = actor {
react {
case 'Die =>
val from = sender
if (next != null) {
next ! 'Die
@infynyxx
infynyxx / git_colorize
Created July 31, 2012 22:19
git colorize
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOUR="\[\033[0m\]"
@infynyxx
infynyxx / ThreeStooges.java
Created July 27, 2012 04:02
immutable class from mutable objects
public final class ThreeStooges {
private final Set<String> stooges = new HashSet<String>();
public ThreeStooges() {
stooges.add("Moe");
stooges.add("Larry");
stooges.add("Curly");
}
public boolean isStooge(String name) {
@infynyxx
infynyxx / scribe_cat.py
Created July 17, 2012 15:14
scribe_cat
#!/usr/bin/python
## Copyright (c) 2007-2008 Facebook
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
@infynyxx
infynyxx / fb.js
Created May 16, 2012 23:05
Using Facebook Graph API JS Object
var logFB = function(url) {
var login_status, _data, _fb, _get_share_count2;
if (url == null) url = false;
if (url === false) url = window.location.href;
_data = {};
_get_share_count2 = function(url, callback) {
var params;
if (typeof window.FB !== 'undefined') {
window.FB.api('/', {
id: url
@infynyxx
infynyxx / hack.sh
Created March 31, 2012 12:41 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#