Skip to content

Instantly share code, notes, and snippets.

@sguzman
sguzman / license-badges.md
Created December 5, 2017 16:21 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.  
  • 🇫🇷 Cette liste en français
  • Github has a new autodetection of the LICENSE file, which shows up the license at the repo overview
* Support for Scala
* Building with SBT
* Support for ScalaFX
@sguzman
sguzman / stack.js
Created March 22, 2018 17:38
A simple VM written in js
const environment = {};
class Number {
constructor(value) {
this.value = value;
}
reducible() {
return false;
}
@sguzman
sguzman / brotli.scala
Created March 30, 2018 21:20
Call brotli from scala - pass it a string to compress and receive a byte array
package com.github.sguzman.scraper.stream.lord
import java.io.{DataInputStream, DataOutputStream}
import scala.sys.process._
object Brotli extends App {
def compress(s: String): Array[Byte] = {
locally {
var output: Array[Byte] = null
@sguzman
sguzman / build.sc
Created March 31, 2018 23:44
Really happy with this build.sc file for mill build tool
import mill._
import mill.scalalib._
import coursier.maven.MavenRepository
import publish._
import java.io.File
object brotli extends PublishModule {
/** Publish version */
def publishVersion = "1.0.0"
@sguzman
sguzman / build.sc
Created April 1, 2018 10:27
Build file for mill that works with binding.scala
import mill._
import mill.scalalib._
import mill.scalajslib._
import coursier.maven.MavenRepository
import publish._
object scalajs extends ScalaJSModule {
/** Main */
def mainClass = Some("com.github.sguzman.scala.js.Main")
@sguzman
sguzman / useragentswitcher.xml
Created April 21, 2018 03:14
Massive list of user agents for User Agent Switcher by Chris Pederik http://forums.chrispederick.com/categories/user-agent-switcher
<useragentswitcher>
<folder description="Browsers - Windows">
<folder description="Legacy Browsers">
<useragent description="Arora 0.6.0 - (Vista)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Avant Browser 1.2" useragent="Avant Browser/1.2.789rel1 (http://www.avantbrowser.com)" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Chrome 4.0.249.0 (Win 7)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Chrome 5.0.310.0 (Server 2003)" useragent="Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9" appcodename="" appname=""
@sguzman
sguzman / curl.hxx
Created April 25, 2018 07:43
Calling curl from C++
#pragma once
#include <curl/curl.h>
#include <string>
namespace Curl {
inline static const size_t CurlWrite_CallbackFunc_StdString(void *contents, const size_t size, const size_t nmemb, std::string *s) noexcept
{
const size_t newLength = size * nmemb;
const size_t oldLength = s->size();
s->resize(oldLength + newLength);
@sguzman
sguzman / war.sh
Created May 19, 2018 06:06
This is war
nmap -vvv -p- -O -Pn -sV --version-intensity 9 -T5
@sguzman
sguzman / extracting.rs
Created June 20, 2018 11:44
Extracting stuff from a page- may need it in the future
println!("Downloading {}", url);
let html = dom::get_html_from_path(url);
let title = dom::get_single_text(&html, "h1.post-title");
let img = {
let img = dom::get_single(&html, "div.book-cover img[src]", "src");
let img = img.trim_left_matches("https://it-eb.com");
format!("http://23.95.221.108{}", img)
};