Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View peas's full-sized avatar

Paulo Silveira peas

View GitHub Profile
@sergiolopes
sergiolopes / 4shared.js
Last active February 11, 2024 23:55
urls do google drive / scribd
javascript:void function(){
var txt = [].slice.call(document.querySelectorAll('.fname h1 a')).map(el => el.href).reduce((url,acc) => acc + '\r\n' + url);
var ta = document.createElement('textarea');
document.body.appendChild(ta);
ta.value = txt;
ta.select();
document.execCommand('copy');
}();
@pokstad
pokstad / gaereverseproxy.go
Last active October 24, 2021 09:35
Google App Engine reverse proxy in Golang
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// HTTP reverse proxy handler
package goengine
import (
"io"
@alexandreaquiles
alexandreaquiles / DiasUteis.java
Last active October 11, 2021 00:31
Passado um ano ou um mês ou alguns meses de um ano, gera um mapa (Map) dos meses (YearMonth) com a lista de datas (LocalDate) que são dias úteis (segunda a sexta).
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.Month;
import java.time.YearMonth;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@guilhermesilveira
guilhermesilveira / gist:723676
Created December 1, 2010 15:55
pimp_my_language.guilhermecaelum

Ximp

The following code shows the Ximp language output for some specific input, showing some of the benefits from using such a nice language.

Defining something

 an Account

is positive? { @amount >= 0 }

True = lambda { |a,b| a }
False = lambda { |a,b| b }
display = lambda { |boolean| boolean['true','false']}
display[True] # => "true"
display[False] # => "false"
And = lambda{ |b1,b2| b1[b2,b1] }
Or = lambda{ |b1,b2| b1[b1,b2] }
#lang racket
(define (pontos x)
(define (soma-lista x) (apply + x))
(define (strike? x) (= (length x) 1))
(define (spare? x) (= (soma-lista x) 10))
(define (pontos2 jogada-anterior jogadas)
;; devolve a proxima jogada, que pode ter um ou dois lances
(define (proxima-jogada)
(if (= (first jogadas) 10)
@viniciusteles
viniciusteles / gist:556029
Created August 29, 2010 06:20
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo