Skip to content

Instantly share code, notes, and snippets.

View annezao's full-sized avatar
🏳️‍🌈
🚀🌈🍡🍷🎨🦄🍑🍙🌩️🥀🧚‍🌊🔮

Arianne annezao

🏳️‍🌈
🚀🌈🍡🍷🎨🦄🍑🍙🌩️🥀🧚‍🌊🔮
View GitHub Profile
@rcotrina94
rcotrina94 / How to use Images as Radio buttons.md
Last active July 20, 2024 11:31
How to use images for radio buttons (input-radio).
@peuweb
peuweb / bancos_brasileiros.php
Created January 10, 2014 18:49
Lista dos bancos brasileiros em formato array
<?php
//bancos brasileiros
$bancos = array(
array('code' => '001', 'name' => 'Banco do Brasil'),
array('code' => '003', 'name' => 'Banco da Amazônia'),
array('code' => '004', 'name' => 'Banco do Nordeste'),
array('code' => '021', 'name' => 'Banestes'),
array('code' => '025', 'name' => 'Banco Alfa'),
array('code' => '027', 'name' => 'Besc'),
array('code' => '029', 'name' => 'Banerj'),
@igorcosta
igorcosta / cpf_cnpj_validator
Created June 26, 2014 19:13
Regex para validar CPF e CNPJ
Para CPF
/^\d{3}\.\d{3}\.\d{3}\-\d{2}$/
Para CNPJ
/^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/
Para ambos ao mesmo tempo
@sphvn
sphvn / traverse.js
Last active October 26, 2023 21:49
Recursively traverse object javascript, recurse json js, loop and get key/value pair for JSON
var traverse = function(o, fn) {
for (var i in o) {
fn.apply(this,[i,o[i]]);
if (o[i] !== null && typeof(o[i])=="object") {
traverse(o[i], fn);
}
}
}
// usage
@christopherlovell
christopherlovell / display.py
Last active November 18, 2023 22:22
display youtube video in jupyter notebook
from IPython.display import HTML
# Youtube
HTML('<iframe width="560" height="315" src="https://www.youtube.com/embed/S_f2qV2_U00?rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>')
# Vimeo
HTML('<iframe src="https://player.vimeo.com/video/26763844?title=0&byline=0&portrait=0" width="700" height="394" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe><p><a href="https://vimeo.com/26763844">BAXTER DURY - CLAIRE (Dir Cut)</a> from <a href="https://vimeo.com/dannysangra">Danny Sangra</a> on <a href="https://vimeo.com">Vimeo</a>.</p>')
app.factory('utils', function() {
return {
validCpf: function(cpf) {
if ( !cpf || cpf.length != 11
|| cpf == "00000000000"
|| cpf == "11111111111"
|| cpf == "22222222222"
|| cpf == "33333333333"
|| cpf == "44444444444"
|| cpf == "55555555555"
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 22, 2024 04:10
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@iamstoick
iamstoick / import.md
Created June 14, 2017 05:03
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p.

@eug
eug / mat2csv.py
Last active April 4, 2022 12:42
Convert .mat to .csv file
import numpy as np
import pandas as pd
from scipy.io import loadmat
def mat2csv(file_mat, index=False):
mat = loadmat(file_mat, squeeze_me=True)
for colname in mat.keys():
# ignore private column names
if colname.startswith("__"):
@swyxio
swyxio / 1.md
Last active February 8, 2024 22:30
Learn In Public - 7 opinions for your tech career

2019 update: this essay has been updated on my personal site, together with a followup on how to get started

2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!

1. Learn in public

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos