Skip to content

Instantly share code, notes, and snippets.

View mfurquimdev's full-sized avatar
🐧

Mateus Furquim mfurquimdev

🐧
View GitHub Profile
<html>
<head>
<title>Hello River</title>
<!--
The Hello World of Rivers
https://github.com/scripting/river5/blob/master/docs/HELLOWORLD.md
-->
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
HOST_NAME = 'localhost'
PORT_NUMBER = 9000
class MyHandler(BaseHTTPRequestHandler):
def do_HEAD(self):
self.send_response(200)
@thesfinox
thesfinox / mp_distr.py
Created March 9, 2021 07:58
Marchenko-Pastur Distribution
# Marchenko-Pastur distribution
# see https://en.wikipedia.org/wiki/Marchenko%E2%80%93Pastur_distribution
def marchenko_pastur(x, c, var=1.0):
'''
Marchenko-Pastur PDF.
Arguments:
x: independent variable,
c: phase transition parameter,
@code-affinity
code-affinity / ofx-to-ledger.py
Created January 24, 2012 16:32
Python script for importing OFX files into a ledger-cli file
from __future__ import print_function
from ofxparse import OfxParser
import os
import re
import sys
if len(sys.argv) != 1:
print ('This utility does not take command-line arguments')
exit()
@fsteffek
fsteffek / hb_all_books_dl.js
Last active April 24, 2022 20:47 — forked from graymouser/hb_all_books_dl.js
Humble bundle book bundles - download all books and md5sums
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
*/
function getTitle() {
var re = /^Humble\ Book\ Bundle\:\ (.*)\ \(/g;
return re.exec(document.title)[1];
}
@rohithteja
rohithteja / gooey_example.py
Last active May 20, 2022 14:31
Gooey Example
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
from sklearn.datasets import make_classification
from sklearn.decomposition import PCA
from sklearn.manifold import LocallyLinearEmbedding
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from gooey import Gooey
" Language Specific scratch buffers with date
" ---------------------------------------------------------------------------------
function! s:DScratch(scratch_ft)
let scratch_dir = '~/Dropbox/scratch/buffers'
let scratch_date = strftime('%Y%m%d')
let scratch_file = 'scratch-'. scratch_date . '.' . a:scratch_ft
let scratch_buf = bufnr(scratch_file)
if scratch_buf == -1
exe 'split ' . scratch_dir . '/' . scratch_file
@DarwinAwardWinner
DarwinAwardWinner / argprint.py
Created August 25, 2011 15:26
Print a Python function's arguments every time it is called
# This file defines a decorator '@log_to()' that logs every call to a
# function, along with the arguments that function was called with. It
# takes a logging function, which is any function that accepts a
# string and does something with it. A good choice is the debug
# function from the logging module. A second decorator '@logdebug' is
# provided that uses 'logging.debug' as the logger.
from __future__ import print_function
from functools import wraps
from inspect import getcallargs, getargspec
@simonmichael
simonmichael / accounts.txt
Last active May 30, 2023 09:43
a sample *ledger chart of accounts (first 3 levels): combined personal & business, eg for a freelancer
assets
business
accounts receivable
bank
personal
accounts receivable
bank
cash
gifts
online
@slimsag
slimsag / ramblings.md
Last active December 13, 2023 08:02
Because cross-compiling binaries for Windows is easier than building natively

Because cross-compiling binaries for Windows is easier than building natively

I want Microsoft to do better, want Windows to be a decent development platform-and yet, I constantly see Microsoft playing the open source game: advertising how open-source and developer friendly they are - only to crush developers under the heel of the corporate behemoth's boot.

The people who work at Microsoft are amazing, kind, talented individuals. This is aimed at the company's leadership, who I feel has on many occassions crushed myself and other developers under. It's a plea for help.

The source of truth for the 'open source' C#, C++, Rust, and other Windows SDKs is proprietary

You probably haven't heard of it before, but if you've ever used win32 API bindings in C#, C++, Rust, or other languages, odds are they were generated from a repository called microsoft/win32metadata.