Skip to content

Instantly share code, notes, and snippets.

@jorgeatorres
jorgeatorres / HelloWorld.java
Created June 17, 2010 13:13
obfuscated HelloWorld java program
public class HelloWorld {public static void main(String[] args){
int[][] t = new int[][]{{202,1026,1100,396,324,1080,192,609,555,888,72,432},
{3,9,8,5},{2,2,5,9},{4,6,1,9,2,11},{4,6,1,9,3,2,11,7,0,5,10},{2,1,5,9},{1,9,2,5},{0,2,10,5,1,6,3,11,8,4},{10,4,2,6},
{1,10,2,3,5,9,7,4,11,6},{7,0,3,6},{2,9,10,1},{7,1,10,6},{12,0,-0}};do{while(t[13][1]+1<t[t[13][0]].length){
t[13][2]=t[0][t[t[13][0]][t[13][1]]];t[0][t[t[13][0]][t[13][1]]]=t[0][t[t[13][0]][++t[13][1]]];t[0][t[t[13][0]][t[13][1]++]]=t[13][2];}
}while(!(--t[13][0]<=(int)Math.sin(Math.PI))&&((t[13][1]=0)<1));
while(t[4][2]<=t[9][5]+3)System.out.print((char)(t[0][t[4][2]-1]/t[4][2]++));}}
/* The world's smallest Brainfuck interpreter in C, by Kang Seonghoon
* http://j.mearie.org/post/1181041789/brainfuck-interpreter-in-2-lines-of-c */
s[99],*r=s,*d,c;main(a,b){char*v=1[d=b];for(;c=*v++%93;)for(b=c&2,b=c%7?a&&(c&17
?c&1?(*r+=b-1):(r+=b-1):syscall(4-!b,b,r,1),0):v;b&&c|a**r;v=d)main(!c,&a);d=v;}
@joshuapowell
joshuapowell / HTML5 Stub
Created April 12, 2011 04:53
A generic & empty HTML5 page structure.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="author" content="" />
<meta name="copyright" content="" />
<meta name="robots" content="index, follow" />
@dupuy
dupuy / README.rst
Last active June 25, 2024 15:05
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@kdabir
kdabir / log4j.properties
Created March 14, 2012 14:17
a minimal log4j config file
log4j.rootLogger=INFO, CONSOLE
# CONSOLE is set to be a ConsoleAppender using a PatternLayout
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %m%n
# a more detailed PatternLayout: %d [%t] %-5p %c - %m%n
# adjust specific logger levels as per the need to control the verbosity of logs
@ymnk
ymnk / AES.java
Last active July 20, 2023 15:54
JSch examples
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
/**
* This program will demonstrate how to use "aes128-cbc".
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
public class AES{
@veryphatic
veryphatic / markov.java
Created July 27, 2012 23:11
Simple Markov chain text generator
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Hashtable;
import java.util.Random;
import java.util.Vector;
public class Markov {
@cliffparnitzky
cliffparnitzky / create_github_tag.sh
Last active December 18, 2020 22:10
Simple way to create a tag via git shell and push it to repo
# creat a tag (more infos at: http://git-scm.com/book/de/ch2-12.html)
git tag -a 1.0.0 -m "Version 1.0.0"
git push origin 1.0.0
git tag -a 1.0.0.alpha1 -m "Version 1.0.0 alpha1"
git push origin 1.0.0.alpha1
# delete a tag
git tag -d 1.0.0
git push origin :refs/tags/1.0.0
@eduardschaeli
eduardschaeli / raspberry-pi-edimax-wifi-and-motion-sensor.md
Last active May 21, 2019 18:26
My notes on setting up a Raspberry Pi with an Edimax EW-7811UN WiFi Dongle and motion sensors

Raspberry Pi, WiFi and motion sensors

My notes on setting up a Raspberry Pi with an Edimax EW-7811UN WiFi Dongle and motion sensors.

We intend to use a few Raspberry Pis around the office, in order to find out if certain rooms are beeing used or not. For this, we need to get WiFi and a motion sensor working.

// see build.gradle for imports
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.core.util.StatusPrinter;
...
public abstract class Utilities {
public static final Logger logger = LoggerFactory.getLogger( "AnyUniqueStringHere" );
...
public static void printLoggerState() {