Skip to content

Instantly share code, notes, and snippets.

View marioidival's full-sized avatar
😶‍🌫️

Mario Idival marioidival

😶‍🌫️
  • Self Employed ;)
  • Campina Grande, Paraíba, Brazil
  • 01:50 (UTC -03:00)
  • X @marioidival
View GitHub Profile
@JulienPalard
JulienPalard / curry.py
Created August 1, 2014 10:51
KISS Python curry
#!/usr/bin/env python
def curry(func):
"""
Decorator to curry a function, typical usage:
>>> @curry
... def foo(a, b, c):
... return a + b + c
@kachayev
kachayev / concurrency-in-go.md
Last active May 4, 2025 05:48
Channels Are Not Enough or Why Pipelining Is Not That Easy
#traduzido e adaptado de http://blog.trinket.io/writing-poetry-in-python/
from random import choice, randint
adjetivos = '''compreensivo temperamental confiável confiável honesto desonesto
interessante chato carinhoso simpático amigável generoso ciumento invejoso
inseguro ambicioso ansioso bondoso sensato sensível teimoso preguiçoso
trabalhador calmo paciente inteligente esperto espirituoso astuto neurótico
ousado apático cínico sarcástico irônico cético alegre conservador pessimista
otimista tolerante corajoso educado mal-educado determinado sociável
solidário arrogante maldoso desajeitado burro independente confiável dependente
@stummjr
stummjr / BSTNode.py
Last active April 27, 2024 23:38
BSTNode.py - Binary Search Tree
# -*- encoding:utf-8 -*-
from __future__ import print_function
class BSTNode(object):
def __init__(self, key, value=None, left=None, right=None):
self.key = key
self.value = value
self.left = left
@gilbert
gilbert / view-model-example.js
Last active October 6, 2019 23:39
Mithril View-Model Example
var Comment = {]
Comment.create = function (attrs) {
return m.request({ method: 'POST', url: '/comments', data: attrs })
}
// A view-model is basically a temporary, disposable copy of a model.
// It allows the user can either commit or cancel the changes they make.
Comment.vm = function (attrs) {
attrs = attrs || {}
@paulohrpinheiro
paulohrpinheiro / 000_novice-problem.py
Last active December 28, 2016 17:43
Primeira lista de exercícios do Test Driven Learning - 000_novice-python3
"""
Test Driven Learning Project.
Desenvolva TDD e programação com TDD e programação!
Módulo novice.
The MIT License (MIT)
Copyright (c) 2016 Paulo Henrique Rodrigues Pinheiro <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
@btroncone
btroncone / ngrxintro.md
Last active July 5, 2025 14:15
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@gilyes
gilyes / Backup, restore postgres in docker container
Last active June 22, 2025 22:25
Backup/restore postgres in docker container
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@meqif
meqif / main.rs
Last active October 3, 2017 11:46
use std::thread;
use std::sync::{Arc, RwLock};
// Represents a reference to a node.
// This makes the code less repetitive to write and easier to read.
type NodeRef<T> = Arc<RwLock<_Node<T>>>;
// The private representation of a node.
struct _Node<T> {
inner_value: T,