Skip to content

Instantly share code, notes, and snippets.

Luiz Paulo de Vasconcellos luizpvas

Block or report user

Report or block luizpvas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View subscription.ex
defmodule AppWeb.Live.Subscription do
use Phoenix.LiveView
alias AppWeb.Router.Helpers, as: Routes
def render(assigns) do
~L"""
<form class="flex" phx-submit="submit">
<div class="w-1/2 mr-8">
<%= if @billing_period == :monthly do %>
<button class="border-2 text-sm py-1 px-2 rounded text-green-500 border-green-500">Monthly</button>
View Colorpicker.elm
module Colorpicker exposing (main)
-- The Browser module has the definition we need to run an Elm application in the
-- Elm architecture.
-- Html is the module that defines the functions `div`, `span`, `button`, etc.
-- Html.Attributes exposes functions for element attributes such as `class` and `id`.
-- Html.Events exposes functions for binding elements such as `onClick` and `onInput`.
import Browser
import Html exposing (..)
@luizpvas
luizpvas / hipsters_scrapper.js
Created Oct 12, 2018
Extração de comentários do Podcast Hipsters.tech
View hipsters_scrapper.js
const puppeteer = require('puppeteer');
const fs = require('fs');
// Ids of the episodes. Each ID must be passed to the URL in the format of
// hipsters.tech?page_id=<page_id>.
//
// I grabbed these ids calling `Array.from(document.querySelectorAll('#page_id option')).map(option => option.value)`
// in any episode page. The episodes are listed in a select input, which was really handy.
let pageIds = ["1940","1932","1915","1923","1910","1901","1893","1884","1877","1868","1864","1854","1847","1823","1800","1791","1785","1763","1757","1749","1740","1736","1729","1718","1708","1697","1689","1684","1676","1661","1646","1642","1635","1623","1614","1591","1586","1571","1548","1526","1508","1475","1468","1445","1416","1404","1391","1371","1355","1339","1326","1298","1281","1262","1245","1067","1040","1141","1129","1115","1005","1058","1045","1030","1015","1007","984","989","963","948","939","930","923","917","887","878","871","866","859","835","827","816","806","793","778","670","680","689","718","685","683","667","
@luizpvas
luizpvas / WikiConsolidator.py
Created Aug 22, 2017
Consolidate the output from WikiExtractor.py
View WikiConsolidator.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ===========================================
#
# WikiConsolidator reads a directory with .bz2 files generated by WikiExtractor.
# The files are compiled into one .txt file, where each line is a pre-processed
# sentence. The following transformations and filters are applied in the text:
#
# * Commas, dots, quotes and parathensis are removed. Question and exclamation
# marks are kept, but with spaces between then and words. For example:
View my_router.ex
defmodule MyRouter do
use Plug.Router
# Starts the server
def start do
Plug.Adapters.Cowboy.http MyRouter, []
end
plug :my_handle # custom plug
plug :match
You can’t perform that action at this time.