Skip to content

Instantly share code, notes, and snippets.

@PedroHLC
PedroHLC / Gradients.elm
Created July 7, 2017 17:49
Gradients from http://uigradients.com ported to Elm
module Gradients exposing (..)
import Css exposing (Style, backgroundImage, linearGradient2, stop, stop2, hex, pct)
-- AUTO Generated from: https://raw.githubusercontent.com/ghosh/uiGradients/master/gradients.json
-- replaced "name": "([\w ]*) with "name": "\E$1
-- replaced "(\w*) (\w) with ""$1\U$2
-- used regex: /^\s*{\s*"name": "([\' \w0-9]*)",\s*"colors": \["#([a-f0-9]*)", "#([a-f0-9]*)", "#([a-f0-9]*)"\]\s*},?/g
-- and with fewer color samples
@PedroHLC
PedroHLC / Helper.elm
Created July 7, 2017 17:24
FontAwesome on Elm using unicode tags
module FontAwesome.Helper exposing (..)
import Css exposing (Style, Snippet, fontFamilies, before)
type alias UnicodeTag =
String
fontAwesome : Style
@PedroHLC
PedroHLC / binary_tree.rs
Created July 1, 2017 20:34
incomplete data structures implemented in Rust for academy purposes
use std::fmt;
use std::any::Any;
// Implements Binary Trees
#[derive(Clone)]
struct BruteBinaryTree<T> {
info: T,
left: BinaryTree<T>,
right: BinaryTree<T>,
}
@PedroHLC
PedroHLC / main.rb
Created June 26, 2017 18:57
PixelCanvas.io Multi-threaded BOT
#!/usr/bin/ruby
# [INCOMPLETE]
# PixelCanvas.io Multi-threaded BOT
require 'free-image'
require 'socket'
require 'net/http'
require 'json'
@PedroHLC
PedroHLC / mingw-w64-gc.PKGBUILD
Last active May 18, 2017 16:37
mingw-w64-gc for ArchLinux
# Original author: Alexey Pavlov <[email protected]>
MINGW_PACKAGE_PREFIX="mingw-w64"
_realname=gc
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=7.4.2
pkgrel=1
pkgdesc="A garbage collector for C and C++ (mingw-w64)"
arch=('any')
url="http://www.hboehm.info/gc"
@PedroHLC
PedroHLC / hostapd-wpe.PKGBUILD
Last active October 30, 2019 16:18
hostapd-wpe 2.8
_pkgname=hostapd
pkgname="${_pkgname}-wpe"
pkgver=2.8
pkgrel=0
pkgdesc="IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator (with hostapd-wpe patch)"
arch=('x86_64' 'aarch64')
url="https://w1.fi/hostapd/"
license=(GPL)
depends=('openssl' 'libnl')
options=(emptydirs)
#include <iostream>
using namespace::std;
class Ponto{
public:
Ponto(int _x=1, int _y=1);
void setX(int _x);
int getX() const;
#include <iostream>
#include <math.h>
#include "circulo.h"
using namespace::std;
ostream& operator<<(ostream &saida, const Cilindro& cl) {
saida << "Cilindro:" << endl << "\t(" << cl.getX() << ", " << cl.getY() << ")" << endl << "\tAltura: " << cl.getAltura()
<< endl << "\tVolume: " << cl.getVolume() << endl;
return saida;
}
@PedroHLC
PedroHLC / experimento_matrizes.cpp
Created December 13, 2016 19:26
Experimento somando matrizes
#include <stdlib.h>
#include <iostream>
using namespace std;
class Matriz {
private:
double *data;
size_t cols;
size_t lins;
@PedroHLC
PedroHLC / ideia.txt
Created September 13, 2016 18:46
PlugInAnyOS
[THIS IS JUST THE HELL OF AN IDEIA I GOT, BUT PROBABLY WILL NEVER IMPLEMENT]
What is PlugInAnyOS?
+ First of all, it isn't an OS.
+ It's actual job is to create, manage and run multiple SOs.
What it can do?
+ Create and manage any OS rootfs using what it calls layers and enviroments.
+ Create and manage pseudo enviroments (in case you want to chroot in a different env, or sandbox some app).
+ Capable of running multiple OSs simulteneously using HVM