Skip to content

Instantly share code, notes, and snippets.

View onlurking's full-sized avatar
:shipit:
ship it

Diogo Felix onlurking

:shipit:
ship it
View GitHub Profile
@onlurking
onlurking / slide-dl.py
Created July 31, 2015 19:51
Python 3 port, PEP8 compliant and up to date version of https://github.com/erinus/slidesaver.
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# pip3 install pyquery requests reportlab
import json
import pyquery
import re
import requests
import reportlab.lib.utils
@onlurking
onlurking / fractal-plan.py
Last active August 29, 2015 14:27
Python3 port of Fractal-Plan (https://github.com/ryukinix/fractal-plan), to run you must install the latest version of pygame(https://bitbucket.org/pygame/pygame/downloads#branch-downloads) using python 3.
import pygame
from pygame.locals import QUIT, KEYDOWN, K_ESCAPE, K_RETURN, \
K_TAB, K_BACKSPACE, K_UP, K_LEFT, K_DOWN, K_RIGHT, K_EQUALS, K_MINUS
from math import sqrt, cos, sin, pi
from random import randint as random
from random import shuffle
from os import listdir
from os.path import join, isdir, isfile, expanduser
from mimetypes import guess_type
@onlurking
onlurking / gist:b8b0f528a76fea11496af52be01fac91
Created June 28, 2016 12:35
DevEnv Shellscript - Draft
#!/usr/bin/env bash
function exists { hash $1 2>/dev/null; }
function !exists { hash $1 >/dev/null 2>&1; }
function elevate{
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
@onlurking
onlurking / init.vim
Created April 7, 2016 18:57
My vimrc
"
" ███████████████████████████
" ███████▀▀▀░░░░░░░▀▀▀███████
" ████▀░░░░░░░░░░░░░░░░░▀████
" ███│░░░░░░░░░░░░░░░░░░░│███
" ██▌│░░░░░░░░░░░░░░░░░░░│▐██
" ██░└┐░░░░░░░░░░░░░░░░░┌┘░██
" ██░░└┐░░░░░░░░░░░░░░░┌┘░░██
" ██░░┌┘▄▄▄▄▄░░░░░▄▄▄▄▄└┐░░██
" ██▌░│██████▌░░░▐██████│░▐██
@onlurking
onlurking / cleverbot.py
Created July 17, 2015 12:31
Cleverbot <-> Facebook Chat, dependencies are sleekxmpp and https://github.com/pierredavidbelanger/chatter-bot-api/, but sadly Facebook deprecated the Chat API, the code doesn't work as expected.
import sleekxmpp
import logging
from chatterbotapi import ChatterBotFactory, ChatterBotType
factory = ChatterBotFactory()
bot1 = factory.create(ChatterBotType.CLEVERBOT)
bot1session = bot1.create_session()
logging.basicConfig(level=logging.DEBUG)
{
"always_show_minimap_viewport": true,
"caret_extra_bottom": 1,
"caret_extra_top": 1,
"caret_extra_width": 1,
"caret_style": "blink",
"color_scheme": "Packages/Colorcoder/Boxy Tomorrow (Colorcoded).tmTheme",
"detect_indentation": false,
"fade_fold_buttons": false,
"font_size": 9,
@onlurking
onlurking / til.md
Last active September 2, 2016 01:08
# TIL (Today I Learned)

TIL (Today I Learned)

Map, Filter, Reduce and Arrow Functions w/ Javascript

Inspiration

const numbers = [1, 2, 3, 4];
const doubled = numbers.map(number => number * 2)
console.log("The doubled numbers are: ", doubled); // [2, 4, 6, 8]
@onlurking
onlurking / fizzbuzz.md
Last active September 6, 2016 01:01
Python FizzBuzz Oneliners
for x in ("FizzBuzz" if num % 15 == 0 else "Fizz" if num % 3 == 0 else "Buzz" if num % 5 == 0 else num for num in range(1,101)): print(x)
for x in ["fizzbuzz" if not x % 15 else "buzz" if not x % 5 else "fizz" if not x % 3 else str(x) for x in range(100)]: print(x)
{
"always_show_minimap_viewport": true,
"caret_extra_bottom": 1,
"caret_extra_top": 1,
"caret_extra_width": 1,
"caret_style": "blink",
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Tomorrow.tmTheme",
"detect_indentation": false,
"fade_fold_buttons": false,
"font_size": 11,