Skip to content

Instantly share code, notes, and snippets.

diff --git a/.gitignore b/.gitignore
index e73dd4d9e8..e3192b3a0d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,7 +24,6 @@ out-vscode-reh-web-min/
out-vscode-reh-web-pkg/
out-vscode-web/
out-vscode-web-min/
-src/vs/server
resources/server
@onilton
onilton / gist:9b197b0003385eefb1e74602b2a0dc0d
Last active July 16, 2020 23:03 — forked from megafaunasoft/gist:6152840
Spectral matting in numpy/scipy
#-----------------------------------------------------------------------------------------
#
# Spectral Matting
#
import time
import logging
import numpy as np
from scipy import ndimage, sparse
import scipy.sparse.linalg as sparse_linalg
@onilton
onilton / ShellPlay.scala
Last active April 7, 2017 00:48
Shell Play
implicit class StringArrayImprovements(a: Array[String]) { def |[T](op: Array[String] => T) = op(a) }
implicit class OptionImprovements(a: Option[String]) { def |(op: Option[String] => String) = op(a) }
import sys.process._
case class CustomCommand(cmd: Symbol, var args: List[Symbol] = List.empty, var largs: List[Symbol] = List.empty) {
def -(x: Symbol) = this.copy(args = args :+ x)
def --(x: Symbol) = this.copy(largs = largs :+ x)
@onilton
onilton / sieve.scala
Last active April 5, 2017 18:29
Sieve of
def sieve(maxNumber: Int) = {
def innerSieve(p: Int, n: Int, a: Array[Boolean]): Array[Boolean] =
if (p >= a.size) a
else if (!a(p) || n >= a.size) innerSieve(p+1, 2*(p+1), a)
else { a(n) = false ; innerSieve(p, p + n, a) }
innerSieve(2, 2, Array.fill(maxNumber+1)(true)).zipWithIndex.filter(_._1).map(_._2)
}
@onilton
onilton / pyrocks.py
Last active March 31, 2017 14:38
PythonRocksBot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# sudo pip install python-telegram-bot
# http://t.me/PythonRocksBot
from telegram.ext import Updater, MessageHandler, Filters
answers = {
@onilton
onilton / acesso.md
Created September 13, 2016 20:11 — forked from felipehummel/acesso.md
API NewsMonitor de Busca de Notícias

Acesso API (URL, Autenticação)

URL base da API NewsMonitor de Busca: https://api.spixdiscovery.com:8083/

A API utiliza autenticação básica HTTP (HTTP Basic Auth). Você receberá de nosso representante uma apiKey e um apiPassword. Para acessar a API será necessário passar esses valores como usuário e senha na autenticação básica HTTP.

Bibliotecas de HTTP, de todas as linguagens de programação, geralmente possuem facilidades para setar diretamente esse usuário e senha de forma fácil.

@onilton
onilton / quill-0.4.0-queryprobing-problem.scala
Created February 25, 2016 19:22
Quill 0.40 Query Probing Problem
package com.nobody
import io.getquill.JdbcSourceConfig
import io.getquill.naming.{ LowerCase, SnakeCase }
import io.getquill.sources.jdbc.JdbcSource
import io.getquill.sources.sql.idiom.MySQLDialect
import io.getquill._
object CustomDbSource {
@onilton
onilton / lista
Created February 24, 2016 15:34
Lista de músicas do show do Rolling Stones SP (2016)
1 - Intro (Satisfaction)
2 - Satisfaction
3 - I can't get no, I can't get no
4 - When I'm drivin' in my car
5 - (I Can't Get No) Satisfaction
6 - Hey hey hey, that's what I say
INTERVALO
7 - Cause I try