Skip to content

Instantly share code, notes, and snippets.

View platinumthinker's full-sized avatar
🌐
Waiting

PlatinumThinker platinumthinker

🌐
Waiting
View GitHub Profile
#!/usr/bin/env escript
-include_lib("kernel/include/inet.hrl").
-include_lib("kernel/include/inet_sctp.hrl").
main([Protocol, IP, Port, Len, Cnt]) ->
bench(list_to_atom(Protocol), inet:parse_address(IP),
list_to_integer(Port), list_to_integer(Len), list_to_integer(Cnt));
main(_) ->
io:format("invalid arguments~n~n"),
from bs4 import BeautifulSoup, Comment
MIN_TEXT_SIZE = 1000
def mine(page):
soup = BeautifulSoup(page, "lxml")
text_areas_list = []
tag_count = 0
section_list = soup.findAll('p')
while len(section_list) > 0:
@bokner
bokner / LTTng+erlang:trace
Last active January 8, 2025 18:54
LTTng+erlang:trace for tracing function calls/returns
1> l(dyntrace).
{module,dyntrace}
2> Match = [{'_', [], [{return_trace}]}]. %% Enable return trace for functions of any arity
[{'_',[],[{return_trace}]}]
3> erlang:trace_pattern({'_','_','_'}, Match, []). %% Trace all functions
2411
4> erlang:trace(all, true, [call,{tracer,dyntrace,[]}]). %% Trace function calls with dyntrace (i.e. LTTng)
@Wunkolo
Wunkolo / compact.cpp
Last active May 5, 2024 20:21
Ascii Raymarcher(old)
#include <math.h>
#include <algorithm>
#include <string>
#include <immintrin.h>
using namespace std;typedef float R;
#define _W 79
#define _H 39
#define EP 0.01f
#define OP operator
#define C const
@ohanhi
ohanhi / frp.md
Last active February 10, 2026 02:16
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

me:
@true
a:
@true
sandwich:
@[ "$$(id -u)" -eq 0 ] && echo "Okay." || echo "What? Make it yourself."
.PHONY: me a sandwich
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active March 23, 2026 00:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@austinmarton
austinmarton / sendRawEth.c
Created February 27, 2012 08:40
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>