Skip to content

Instantly share code, notes, and snippets.

View sergiogarciadev's full-sized avatar
I turn coffee into code (sometimes in bugs).

Sergio Garcia sergiogarciadev

I turn coffee into code (sometimes in bugs).
View GitHub Profile
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"draw_white_space": "all",
"font_size": 10,
"ignored_packages":
[
"Vintage"
],
@sergiogarciadev
sergiogarciadev / make_pi.py
Created February 22, 2016 18:02
Calculate pi up to n digits
import sys
def make_pi(digits):
def _make_pi(digits):
q, r, t, k, m, x = 1, 0, 1, 1, 3, 3
count = -1
for j in range(sys.maxsize):
if count >= digits:
break
if 4 * q + r - t < m * t:
@sergiogarciadev
sergiogarciadev / python-cli.sh
Created April 27, 2016 19:02 — forked from nepsilon/3-python-module-you-can-use-on-cli.md
3 Python modules you can use directly on the CLI
# Start a local webserver to serve the file of your current directory on the LAN:
# Python version 2.x:
python -m SimpleHTTPServer
# Python version 3.x:
python3 -m http.server
#Start a local SMTP server to debug your app emails. Emails will be printed on stdout:
python -m smtpd -c DebuggingServer -n
#Parse and prettify a JSON string with:
@sergiogarciadev
sergiogarciadev / bovespa_intraday.py
Created May 19, 2016 20:38 — forked from maurobaraldi/bovespa_intraday.py
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
query UserRepositories($user: String!, $after: String!) {
repositoryOwner(login: $user) {
repositories(first: 3, after: $after) {
edges {
cursor
node {
id
name
description
hasWikiEnabled
// https://buch415.github.io/game-off-2016/
// 648
setup: function () {
this.canonPosition = 48;
this.maxEnemyPosition = 790;
this.maxShootPosition = 700;
this.minShootPosition = 400;
this.currentEnemy = null;
this.enemies = [];

Código de Conduta do Contribuidor

Como contribuintes e mantenedores deste projeto, e no interesse de promover uma comunidade aberta e acolhedora, nós nos comprometemos a respeitar todas as pessoas que contribuem enviando issues, requisitando funcionalidades, atualizando a documentação, enviando pull requests, patches e outras atividades.

Estamos empenhados em tornar a participação neste projeto uma experiência livre de assédio para todos, independentemente do nível de experiência, gênero, identidade de gênero e expressão, orientação sexual, deficiência, aparência pessoal, tamanho do corpo, raça, etnia, idade, orientação política, religião ou nacionalidade.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sergiogarciadev
sergiogarciadev / extend.js
Created May 18, 2017 18:41
Mixins in Javascript
function extend() {
var destination = arguments[0];
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var k in source) {
if (source.hasOwnProperty(k)) {
destination[k] = source[k];
}
}
@sergiogarciadev
sergiogarciadev / post_install.sh
Last active June 18, 2017 16:46
Ubuntu 16.04 Post Install
#!/bin/bash
# Run this as:
# curl -sL https://gist.github.com/LawfulHacker/72fc772a66cb5e1806907ac5c2bb8e90/raw/post_install.sh | bash -
#
# Update
#
sudo apt-get update && sudo apt-get upgrade -y