Skip to content

Instantly share code, notes, and snippets.

View daltonmenezes's full-sized avatar
:octocat:
"Hey ho, let's code" - R4m0n3s

Dalton Menezes daltonmenezes

:octocat:
"Hey ho, let's code" - R4m0n3s
View GitHub Profile
@daltonmenezes
daltonmenezes / ImdbTitleCrawler.py
Created May 3, 2016 09:14
simple crawler for a title on a specific profile on IMDB.
from lxml import html
import requests
page = requests.get('http://www.imdb.com/title/tt0944947/')
tree = html.fromstring(page.content)
title = tree.xpath('//h1[@itemprop="name"]/text()')[0]
print title
@daltonmenezes
daltonmenezes / howto-gcc-5.2-ubuntu15.04.sh
Last active May 20, 2016 06:09 — forked from maxlevesque/build_gcc.sh
how to install gcc 5.2 on ubuntu 15.04
sudo apt-get install libgmp-dev libmpc-dev libisl-dev libmpfr-dev
wget http://mirrors-usa.go-parts.com/gcc/releases/gcc-5.2.0/gcc-5.2.0.tar.bz2
tar jxvf gcc-5.2.0.tar.bz2
mkdir objdir
cd objdir
../gcc-5.2.0/configure --prefix=/tmp/mygcc5.2 --disable-multilib --disable-werror
make -j
make install
@daltonmenezes
daltonmenezes / doubt.py
Created June 9, 2016 03:21
need to fix
import gtk
def mouse_enter(win, event):
win.set_decorated(True)
def mouse_leave(win, event):
win.set_decorated(False)
win = gtk.Window()
win.set_decorated(False)
@daltonmenezes
daltonmenezes / main.js
Last active April 29, 2017 12:42
Electron trick to fix the webview crash on page navigation in Linux distributions
if (process.platform === 'linux') {
app.disableHardwareAcceleration();
}
date1 = '2017-10-26T08:49:23.687Z'
date2 = '2017-10-26T08:s#$#$#$#$49:23.687Z'
date3 = new Date('2017-10-26')
date4 = '2017-10-26'
isValidDate(date1) // true
isValidDate(date2) // false
isValidDate(date3) // true
isValidDate(date4) // true
<plugin-section></plugin-section>
<script>
const Extensible = require('extensible')
const Render = require('extensible').Render // this will be global for extensions,
// if we don't do this, the extension creators will use Render using Extensible.Render() instead of Render()
const plugin = Extensible.load({
context: 'plugin',
@daltonmenezes
daltonmenezes / netflix-my-list.js
Last active May 11, 2018 04:53
Lists My List from Netflix in text format and places it on the clipboard to share it.
list = ''
document.querySelectorAll('.video-preload-title-label').forEach(name => list += `${name.textContent} \n`)
copy(list)
console.log(list)
@daltonmenezes
daltonmenezes / remove-accent.js
Created November 25, 2018 06:10
Função de uma linha para remover acentos | Inline function to remove accents
const removeAccent = s => s.normalize('NFD').replace(/[\u0300-\u036f]/g, '')
{
"settings": "{\n \"workbench.startupEditor\": \"newUntitledFile\",\n \"workbench.colorTheme\": \"One Monokai 80s\",\n \"editor.tabSize\": 2,\n \"terminal.external.linuxExec\": \"zsh\",\n \"terminal.integrated.shell.osx\": \"/bin/zsh\",\n \"editor.minimap.enabled\": false,\n \"window.zoomLevel\": 0,\n \"javascript.updateImportsOnFileMove.enabled\": \"always\",\n \"editor.wordWrap\": \"on\",\n \"breadcrumbs.enabled\": false,\n \"editor.overviewRulerBorder\": false\n}\n",
"keybindings": "// Place your key bindings in this file to overwrite the defaultsauto[]\n[\n {\n \"key\": \"f5\",\n \"command\": \"workbench.action.debug.continue\",\n \"when\": \"inDebugMode\"\n },\n {\n \"key\": \"f5\",\n \"command\": \"-workbench.action.debug.continue\",\n \"when\": \"inDebugMode\"\n }\n]",
"snippets": [
{
"dalton.code-snippets": "{\n\t\"Print to console\": {\n\t\t\"scope\": \"javascript,typescript\",\n\t\t\"prefix\": \"log\",\n\t\t\"body\": [\n\t\t\t\"
@daltonmenezes
daltonmenezes / instagram-dark-theme.js
Last active March 16, 2019 03:52
Instagram Dark Theme for Web
var style = document.createElement('style')
style.textContent = `
html, body { display: contents; }
html, body, img, time, div[role=button] canvas, .coreSpriteDropdownArrowGrey9, button .glyphsSpriteHeart__outline__24__grey_9, .glyphsSpriteComment__outline__24__grey_9, .glyphsSpriteShare__outline__24__grey_9, .glyphsSpriteSave__outline__24__grey_9, video { filter: invert(1); }
.glyphsSpriteComment_like, .glyphsSpriteMore_horizontal__outline__24__grey_9 { filter: invert(1) !important; color: white !important; }
li div span span, main div button { filter: invert(1) !important; color: white !important; }
li div span span a { color: #77b3d8 !important; }
label { filter: invert(1) !important; }
header button img, button span img, button div canvas { filter: invert(0) !important; }
time { color: #77b3d8 !important; }