Skip to content

Instantly share code, notes, and snippets.

View mvrozanti's full-sized avatar

Marcelo mvrozanti

View GitHub Profile
@laobubu
laobubu / ABOUT.md
Last active May 12, 2024 11:48
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913
@stefanbuck
stefanbuck / upload-github-release-asset.sh
Last active November 26, 2023 12:40
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
int main(int argc, char *argv[])
{
unsigned long value;
char *terminatedAt;
@tyuiko
tyuiko / argparsecheetsheet.py
Created April 19, 2016 16:40
argparse cheat sheet
import argparse
parser = argparse.ArgumentParser()
### Positional
parser.add_argument('positional1')
parser.add_argument('positional2', help="positional argument 2")
parser.add_argument('positional3', help="positional argument 3 type int", type=int)
### Optional
parser.add_argument("--optional1", help="optional argument 1")
parser.add_argument("--optional2", help="optional argument 2", action="store_true")
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
Include file (Java)
<%@ include file="/WEB-INF/jsp/common/date.jsp" %>
Include file (JSP)
<jsp:include page="/WEB-INF/jsp/common/date.jsp">
@Schemetrical
Schemetrical / The_Jaunt.md
Last active May 19, 2024 22:19
The Jaunt by Stephen King

Chapter 1

"This is the last call for Jaunt-701," the pleasant female voice echoed through the Blue Concourse of New York's Port Authority Terminal. The PAT had not changed much in the last three hundred years or so - it was still gungy and a little frightening. The automated female voice was probably the most plesant thing about it. "This is Jaunt Service to Whitehead City, Mars," the voice continued. "All ticketed passengers should now be in the Blue Concourse sleep lounge. Make sure your validation papers are in order. Thank you."The upstairs lounge was not at all grungy. It was wall-to-wall carpeted in oyster gray. The walls were an eggshell white and hung with plesant nonrepresentational prints. A steady, soothing progression of colors met and swirled on the ceiling. There were one hundred couches in the large room, neatly spaced in rows of ten. Five Jaunt attendants circulate, speakingin low, cherry voices and offering glasses of milk. At one side of the room was the entranceway, flanked by armed guar

@mogproject
mogproject / PythonUnitTestCheatSheet.md
Created July 24, 2015 11:17
Python unittest Cheat Sheet

Python unittest Cheat Sheet

Skeleton

@mrw34
mrw34 / gist:b12531d1a8df25f6c170
Last active April 14, 2024 17:39
Trello JSON to CSV conversion using jq
jq -r '["List", "Card"], ((reduce .lists[] as $list ({}; .[$list.id] = $list.name)) as $lists | .cards[] | select(.closed != true) | [$lists[.idList],.name]) | @csv' <nw3RUeLl.json
@magnetikonline
magnetikonline / README.md
Last active May 14, 2024 23:37
Bash getopts usage template.

Bash getopts usage template

#!/bin/bash -e

function usage {
	cat &lt;&amp;2
@maurobaraldi
maurobaraldi / bovespa_intraday.py
Last active March 28, 2024 09:41
Cotações da Bovespa Intraday
#!/usr/bin/env python
from datetime import datetime
from json import loads
from time import gmtime, mktime, strptime
# LevelDict é um wrapper usando dicionário para LevelDB
# https://github.com/maurobaraldi/leveldict
from leveldict import LevelJsonDict
from requests import get