Skip to content

Instantly share code, notes, and snippets.

@PedroHLC
PedroHLC / PKGBUILD
Last active September 19, 2022 22:17
JabRef with SonarQube plugin
# JabRef with SonarQube plugin
# * You might need to install and start sonarqube service before installing:
# pacman -S sonarqube; systemctl start sonarqube
# * To get missing files: Download 'jabref' src's package from archlinux.org
# * Tested with versions: 3.0 3.5 4.0
pkgname_=jabref
pkgname=${pkgname_}-sonarqube
provides=(${pkgname_}})
conflicts=(${pkgname_}})
module PedroHLC.Stack
exposing
( Stack
, empty
, isEmpty
, reverse
, singleton
, length
, push
, pop
@PedroHLC
PedroHLC / test.elm
Created July 11, 2017 00:04
inline condition in Elm
(?) : Bool -> ( a, a ) -> a
(?) cond ( ifTrue, ifFalse ) =
if cond then
ifTrue
else
ifFalse
(?) : a -> a -> ( a, a )
(?) ifTrue ifFalse =
@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 <alexpux@gmail.com>
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;