Skip to content

Instantly share code, notes, and snippets.

View solebox's full-sized avatar
🐼
I may be slow to respond.

jacob kili solebox

🐼
I may be slow to respond.
View GitHub Profile
#!/usr/bin/python
class Analyzer(object):
def __init__(self, filename):
self.parsed_file = []
data = []
with open(filename, "r") as csv_file:
data = csv_file.readlines()
data = [line.split(",") for line in data]
class A
def fooz
puts "bar"
end
end
class A
alias_method :super_send, :send
def send(symbol,*args)
public BruteCollinearPoints(Point[] points){
if (points == null)
throw new NullPointerException();
for (int p1 = 0; p1 < points.length; p1++){
for (int p2 = 0; p2 < points.length; p2++){
for (int p3 = 0; p3 < points.length; p3++){
for (int p4 = 0; p4 < points.length; p4++){
if (p1 != p2 && p1 != p3 && p1 != p4 && p2 != p3 && p2 != p4 && p3 != p4){
@solebox
solebox / woot
Created November 10, 2016 01:15
class FtpServer
def initialize(username, password)
@username = username
@password = password
end
def fxp(destination, local_path, remote_path)
remote_pass = destination.@password
local_pass = @password
bundle init && gem list --local |head -n -1 | awk '{print "gem \47"$1"\47, " "\47"$2"\47"}'|sed 's/[()]//g' >> Gemfile
using System;
2
3 public class Program
4 {
5 public static void Main()
6 {
7 CalculateClient client = new CalculateClient();
8
9 client.SetCalculate(new Minus());
10 Console.WriteLine("Minus: " + client.Calculate(7, 1));
@solebox
solebox / module.md
Created October 23, 2016 08:37 — forked from dvirsky/module.md

Creating a redis Module in 15 lines of code!

A quick guide to write a very very simple "ECHO" style module to redis and load it. It's not really useful of course, but the idea is to illustrate how little boilerplate it takes.

Step 1: open your favorite editor and write/paste the following code in a file called module.c

#include "redismodule.h"
/* ECHO <string> - Echo back a string sent from the client */
int EchoCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
/*
* CVE-2016-5195 dirtypoc
*
* This PoC is memory only and doesn't write anything on the filesystem.
* /!\ Beware, it triggers a kernel crash a few minutes.
*
* gcc -Wall -o dirtycow-mem dirtycow-mem.c -ldl -lpthread
*/
#define _GNU_SOURCE
import React from "react";
import ReactDOM from "react-dom";
class App extends React.Component {
constructor(){
super();
this.state = {text: "click to change"};
}
import React from "react";
import ReactDOM from "react-dom";
class App extends React.Component {
constructor(){
super();
this.state = {text: "click to change"};
}
ouch(){