Skip to content

Instantly share code, notes, and snippets.

View jrmmendes's full-sized avatar
🌏
Remote First

Romildo Júnior (Mendes) jrmmendes

🌏
Remote First
View GitHub Profile
@jrmmendes
jrmmendes / clearfix.css
Created September 9, 2018 13:24
Clearfix hack
/* From www.w3schools.com/css/css_float.asp */
.clearfix::after {
content: "";
clear: both;
display: table;
}
@jrmmendes
jrmmendes / mux.tdf
Created September 21, 2018 15:50
Multiplexer example in AHDL using IF/THEN/ELSE
TITLE "M2X1";
SUBDESIGN mux
(
a, b, sel: INPUT;
result: OUTPUT;
)
BEGIN
IF sel == 0 THEN
result = a;
@jrmmendes
jrmmendes / bcd2onehot.tdf
Created September 21, 2018 16:05
BCD to One-Hot Decoder
TITLE "D24";
SUBDESIGN decoder_2_to_4
(
inpcode[1..0]: INPUT;
outcode[3..0]: OUTPUT;
)
BEGIN
CASE inpcode[] IS
@jrmmendes
jrmmendes / rising_edge_identifier.tdf
Created September 21, 2018 16:25
Edge identifier in AHDL
TITLE "RISING EDGE IDENTIFIER";
SUBDESIGN edge_identifier (
x, clock: INPUT;
rising_edge: OUTPUT;
)
VARIABLE
ss: MACHINE WITH STATES (s0, s1);
@jrmmendes
jrmmendes / ppa_list.sh
Created September 22, 2018 12:32
Simple script to list all the installed PPA's
#! /bin/sh
echo;
for APT in `find /etc/apt/ -name \*.list`; do
grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do
USER=`echo $ENTRY | cut -d/ -f4`
PPA=`echo $ENTRY | cut -d/ -f5`
#echo sudo apt-add-repository ppa:$USER/$PPA #use this if you want to make the output ready to share
echo ppa:$USER/$PPA
done
@jrmmendes
jrmmendes / DE115PIN.qsf
Created October 5, 2018 19:25
Complete pin assignments for DE115
# Complete pin assignments for DE115
# By JRMJ <[email protected]>
# -------------------------------------------------------------------------- #
# Slide switchs
# -------------------------------------------------------------------------- #
set_location_assignment PIN_AB28 -to SW[0]
set_location_assignment PIN_AC28 -to SW[1]
set_location_assignment PIN_AC27 -to SW[2]
@jrmmendes
jrmmendes / clone.java
Created October 15, 2018 08:45
Utilização do método clone() através da implementação de Cloneable
/*
* Code by José Romildo M. Júnior <[email protected]>
*/
package snippets;
class Example implements Cloneable {
private double d;
private String name;
@jrmmendes
jrmmendes / django.bash
Created November 1, 2018 21:50
Comandos básicos do Django
# Criar Projeto
django-admin startproject <nome_do_projeto>
# Adicionar App ao projeto
@jrmmendes
jrmmendes / heroku-error.txt
Created November 22, 2018 22:43
Erro ao tentar dar deploy no heroku
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.7
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting Django==2.1 (from -r /tmp/build_519405a6e8ad50f50bd18e6856196acb/requirements.txt (line 1))
remote: Downloading https://files.pythonhosted.org/packages/51/1a/e0ac7886c7123a03814178d7517dc822af0fe51a72e1a6bff26153103322/Django-2.1-py3-none-any.whl (7.3MB)
remote: Collecting pkg-resources==0.0.0 (from -r /tmp/build_519405a6e8ad50f50bd18e6856196acb/requirements.txt (line 2))
@jrmmendes
jrmmendes / exemplo-svg-inline.html
Created November 27, 2018 13:36
Snippet com uso de SVG Inline
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Exemplo de uso de SVG</title>
</head>
<style>
body{