Skip to content

Instantly share code, notes, and snippets.

View infynyxx's full-sized avatar
🫐

Prajwal Tuladhar infynyxx

🫐
View GitHub Profile
@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
#
@infynyxx
infynyxx / sailthru_email_api.cs
Created February 14, 2012 15:35
Making Email API call with C# client
string apiKey = "***************";
string secret = "***************";
SailthruClient client = new SailthruClient(apiKey, secret);
SailthruResponse response;
EmailRequest emailRequest = new EmailRequest();
emailRequest.email = "praj@sailthru.com";
Hashtable fieldsVar = new Hashtable();
fieldsVar.Add("name", "prajwal tuladhar");
fieldsVar.Add("state", "NY");
@infynyxx
infynyxx / ace_build_error
Created January 23, 2012 15:37
ace build error
praj-mba:ace praj$ ./Makefile.dryice.js normal
# ace ---------
copy.source.commonjs is deprecated, pass { project:... includes:...} directly as a source
Failed to find module: ../../../../../lib/fixoldbrowsers
Failed to find module: ../../../../../lib/dom
Failed to find module: ../../../../../lib/event
Failed to find module: ../../../../../editor
Failed to find module: ../../../../../edit_session
Failed to find module: ../../../../../undomanager
Failed to find module: ../../../../../virtual_renderer