Skip to content

Instantly share code, notes, and snippets.

View barkinet's full-sized avatar

Mustapha Ben Daoud Barki barkinet

View GitHub Profile
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@barkinet
barkinet / gist:0fef614e2361f9bcbc04d1d923692247
Created June 9, 2017 04:05 — forked from rfreedman/gist:1214540
modified Mammal CoffeeScript example
class Mammal
constructor: (@species, @defining_char) ->
print: ->
"Hello I'm a " + @species + ". " +
"I have " + @defining_char + "."
cat = new Mammal('cat', 'claws')
alert(cat.print())
@barkinet
barkinet / gist:9c730dc7f56d5ff1017c93b417a98168
Created June 9, 2017 04:04 — forked from solenoid/gist:1372386
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};
@barkinet
barkinet / console.js
Created June 9, 2017 04:03 — forked from primaryobjects/console.js
Overwrites console.log to send messages to a server.
(function(){
var oldLog = console.log;
console.log = function (message) {
// DO MESSAGE HERE.
alert('hi!');
oldLog.apply(console, arguments);
};
})();
@barkinet
barkinet / eternalblue8_exploit.py
Created May 18, 2017 16:36 — forked from worawit/eternalblue8_exploit.py
Eternalblue exploit for Windows 8/2012
#!/usr/bin/python
from impacket import smb
from struct import pack
import os
import sys
import socket
'''
EternalBlue exploit for Windows 8 and 2012 by sleepya
The exploit might FAIL and CRASH a target system (depended on what is overwritten)
@barkinet
barkinet / IDE.md
Created April 1, 2017 01:00 — forked from ndmitchell/IDE.md

Haskell can be written using nothing more than a text editor, and most popular editors include Haskell syntax highlighting out of the box. In addition, some editors can be enhanced to provide IDE-like features, using the tools listed below.

Intero (Emacs enhancement)

  • Provides instant error feedback, completions, go to definition, applying suggestions, type of expression.
  • Works with GHC 7.8 onwards, benefits from Stack.
@barkinet
barkinet / hlint.prof
Created April 1, 2017 00:59 — forked from ndmitchell/hlint.prof
Example of a profile report that displays badly in Profiteur
Tue Jan 24 08:33 2017 Time and Allocation Profiling Report (Final)
hlint +RTS -p -RTS src
total time = 2.27 secs (2274 ticks @ 1000 us, 1 processor)
total alloc = 42,443,280,112 bytes (excludes profiling overheads)
COST CENTRE MODULE %time %alloc
uniplateData Data.Generics.Uniplate.Internal.Data 41.4 68.1
@barkinet
barkinet / mtg-neo4j-ideas.adoc
Created April 1, 2017 00:56 — forked from jexp/mtg-neo4j-ideas.adoc
MtG in Neo4j ideas

Magic The Gathering (MtG) in Neo4j

Model

  • Model editions, stories, people

  • types, rarity of cards via labels

  • correlate via artists / authors

  • backstories / rulings for cards

  • add well known players and their decks

@barkinet
barkinet / MgEspeak.java
Created April 1, 2017 00:55 — forked from jexp/MgEspeak.java
MUD MorgenGrauen Konverter für Umlaute und Reformat auf breitere Spalten für ESpeak -> http://mg.mud.de
import java.util.*;
import java.io.*;
public class MgEspeak {
private static String[] umlaute = {"Ae", "Ä", "AE", "Ä", "ae", "ä", "Oe", "Ö", "OE", "Ö", "oe", "ö", "UE", "Ü", "Ue", "Ü", "ue", "ü" };
public static void main(String[] args) throws Exception {
int spalten = args.length > 0 ? Integer.parseInt(args[0]) : 130;
Set<String> ausnahmen = new HashSet(Arrays.asList("feuer","mauer"));
File f = new File("ausnahmen.txt");
@barkinet
barkinet / Volnitsky.java
Created April 1, 2017 00:55 — forked from jexp/Volnitsky.java
Some implementation spikes of the Volnitsky substring search algorithm in java
import sun.misc.Unsafe;
import java.util.Arrays;
import java.util.Random;
/**
* @author mh
* @since 12.02.11
*/
public class StringSearcher {