Skip to content

Instantly share code, notes, and snippets.

View jahan-paisley's full-sized avatar
🌠
Working on lovely stuff

Jahan Zinedine jahan-paisley

🌠
Working on lovely stuff
View GitHub Profile
"/Applications/IntelliJ IDEA.app/Contents/jbr/Contents/Home/bin/java" "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=64404:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath /Users/jani/Projects/kafka/kakfa-producer-consumer-example/target/classes:/Users/jani/.m2/repository/org/apache/kafka/kafka-clients/1.1.0/kafka-clients-1.1.0.jar:/Users/jani/.m2/repository/org/lz4/lz4-java/1.4/lz4-java-1.4.jar:/Users/jani/.m2/repository/org/xerial/snappy/snappy-java/1.1.7.1/snappy-java-1.1.7.1.jar:/Users/jani/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/Users/jani/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.5/jackson-databind-2.9.5.jar:/Users/jani/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar:/Users/jani/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.5/jackson-core-2.9.5.jar com.gaurav.kafka.App
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaul
//This is how the data looks like at the begginning
//rejection.data: Blob(54) {size: 54, type: "application/json"}
var arrayBuffer;
var fileReader = new FileReader();
fileReader.onload = function() {
arrayBuffer = this.result;
};
fileReader.readAsArrayBuffer(rejection.data);
@jahan-paisley
jahan-paisley / p1.rb
Last active September 21, 2015 20:39
#! /usr/bin/ruby
def test(e,f)
(0..e.length-2).all?{|i| (e[i]-e[i+1]).abs==f[i]}
end
k= ARGV[0].to_i
a= (1..2*k-1).to_a
a.permutation(k).each do |e|
(a-e).permutation(k-1).each do |f|
puts e.to_s, f.to_s if test(e,f.to_a)
// Modulo 97 for huge numbers given as digit strings.
function mod97(digit_string)
{
var m = 0;
for (var i = 0; i < digit_string.length; ++i)
m = (m * 10 + parseInt(digit_string.charAt(i))) % 97;
return m;
}
// Calculate 2-digit checksum of an IBAN.
@jahan-paisley
jahan-paisley / RequestForChange.xpdl
Last active August 29, 2015 14:00
Shark XPDL Upload log
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://www.wfmc.org/2008/XPDL2.1" xmlns:xpdl="http://www.wfmc.org/2008/XPDL2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Id="Package_requestforchange" xsi:schemaLocation="classpath:bpmnxpdl_31.xsd" >
<PackageHeader>
<XPDLVersion>2.1</XPDLVersion>
<Vendor/>
<Created/>
</PackageHeader>
<Script Type="text/java"/>
<TypeDeclarations>
<TypeDeclaration Id="Reference">
@jahan-paisley
jahan-paisley / liferay-jboss.log
Created April 13, 2014 12:57
liferay-jboss.log
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /home/zeinoddin/Apps/liferay-portal-6.2-ce-ga2/jboss-7.1.1
JAVA: /usr/local/java/jdk1.6.0_45/bin/java
JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=512m
require 'jcouchbase'
require 'json'
include Java
import com.couchbase.client.protocol.views.Query
class Couchbase
attr_accessor :client
require 'em-http-request'
DEL = '-'*40
@results = 0
def run_with_proxy
connection_opts = {:proxy => {:host => '127.0.0.1', :port => 9050, :type => :socks5}}
conn = EM::HttpRequest.new("http://www.apolista.de/tegernsee/kloster-apotheke", connection_opts)
http = conn.get
http.callback {
@jahan-paisley
jahan-paisley / new_customer.html
Created November 1, 2012 07:07
new customer full html
<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7">
<![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8">
<![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9">
<![endif]-->
@jahan-paisley
jahan-paisley / census_geographic_units_of_iran.rb
Created October 24, 2012 14:11
Extract census geographic units of Iran from Interior Ministry Website
# -*- coding: utf-8 -*-
require 'nokogiri'
require 'open-uri'
require 'debugger'
require 'net/http'
# Get a Nokogiri::HTML::Document for the page we’re interested in...