Skip to content

Instantly share code, notes, and snippets.

View abarreir's full-sized avatar
🍗

Alexandre Barreira abarreir

🍗
View GitHub Profile
@abarreir
abarreir / NavAwareTable.tsx
Created October 16, 2023 08:54
Navigation-aware ant design table
import { Table as AntTable } from "antd";
import { TableProps } from "antd/es/table";
import { useSearchParams } from "react-router-dom";
export default function Table<RecordType extends object = any>(
props: TableProps<RecordType>
) {
let [searchParams, setSearchParams] = useSearchParams();
let current = searchParams.has("page")
? parseInt(searchParams.get("page")!)
@abarreir
abarreir / genViewbox.js
Created October 16, 2014 18:58
Generate viewBox attributes for svgs based on width and height when set
var fs = require('fs');
var DOMParser = require('xmldom').DOMParser;
var XMLSerializer = require('xmldom').XMLSerializer;
var addViewboxToSvg = function(svgPath) {
fs.readFile(svgPath, 'utf-8', function(error, svgStr) {
if (error) {
return console.log(error)
}
@abarreir
abarreir / keybase.md
Created September 22, 2014 17:06
keybase.md

Keybase proof

I hereby claim:

  • I am abarreir on github.
  • I am abarreir (https://keybase.io/abarreir) on keybase.
  • I have a public key whose fingerprint is F01A 7213 F4EC D4D8 A494 2EDC 7FBC AD21 188C 56DB

To claim this, I am signing this object:

@abarreir
abarreir / gmusic_multiple_artists.py
Created May 20, 2014 21:23
Get some data about gmusic-api tracks with multiple artist ids
from gmusicapi import Mobileclient
username = u''
password = u''
mul_artist_ids = 0
first_is_the_one = 0
first_isnt_the_one = []
api = Mobileclient()