Skip to content

Instantly share code, notes, and snippets.

@Roemerb
Roemerb / rijndael256.c
Last active August 29, 2015 14:16
C Mcrypt Rijndael-256 en/decryptor
/*
Encrypts and decrypts text in Rijndael-256.
When compiling, make sure you have libmcrypt installed and use the -lmcrypt flag for GCC.
To install libmcrypt on Ubuntu/Debian/Elementary: (sudo) apt-get install libmcrypt-dev
Copyright Roemer Bakker - 2015
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@Roemerb
Roemerb / gist:2c7ce7c4e1b84909f341
Created March 10, 2015 13:34
wireles script result
########## wireless info START ##########
Report from: 10 Mar 2015 14:27 CET +0100
Booted last: 10 Mar 2015 13:53 CET +0100
Script from: 20 Sep 2014 23:04 UTC +0000
##### release ###########################
public static function calculate_days($from,$to) {
$aryRange=array();
$iDateFrom=mktime(1,0,0,substr($from,5,2), substr($from,8,2),substr($from,0,4));
$iDateTo=mktime(1,0,0,substr($to,5,2), substr($to,8,2),substr($to,0,4));
if ($iDateTo>=$iDateFrom)
{
array_push($aryRange,date('Y-m-d',$iDateFrom)); // first entry
while ($iDateFrom<$iDateTo)
require 'octokit'
module Gissues
class Github::User < Gissues::Github
def initialize
@client = nil
@token = nil
end
<?php
require_once 'smppclient.class.php';
require_once 'gsmencoder.class.php';
require_once 'sockettransport.class.php';
// Construct transport and client
$transport = new SocketTransport(array('smpp.provider.com'),2775);
$transport->setRecvTimeout(10000);
$smpp = new SmppClient($transport);
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io/ioutil"
"strconv"
"strings"
@Roemerb
Roemerb / make_csv.go
Last active December 25, 2017 14:54
Convert ACL movie review files to csv
package main
import (
"bufio"
"encoding/csv"
"errors"
"fmt"
"io/ioutil"
"log"
"os"
class Ding
{
public static int[][] splitInBuckets(int min, int max, int nBuckets, int[] arr) throws Exception
{
if (min < 0)
{
throw new Exception("min cannot be smaller than 0");
}
int[][] output = new int[nBuckets][];
int[] distribution = new int[nBuckets];
class Ding
{
public static int[][] splitInBuckets(int min, int max, int nBuckets, int[] arr) throws Exception
{
if (min < 0)
{
throw new Exception("min cannot be smaller than 0");
}
int[][] output = new int[nBuckets][]; // the output array
int[] distribution = new int[nBuckets]; // stores the distribution of elements in the array
package day3
import (
"bufio"
"errors"
"fmt"
"log"
"os"
)