Skip to content

Instantly share code, notes, and snippets.

Avatar
古見さんは、コミュ症です。

filipemeneses

古見さんは、コミュ症です。
View GitHub Profile
@filipemeneses
filipemeneses / countries.json
Created Mar 29, 2018
List of countries with flag, iso and unicode
View countries.json
[
{
"iso": "AD",
"name": "Andorra",
"unicode": "U+1F1E6 U+1F1E9",
"flag": "🇦🇩"
},
{
"iso": "AE",
"name": "United Arab Emirates",
@filipemeneses
filipemeneses / before_being_document.tex
Last active Apr 30, 2019
Javascript pt-br latex listing
View before_being_document.tex
\usepackage{color}
\usepackage{listings}
% ---
% Estilo para código JavaScript
% ---
\definecolor{lightgray}{rgb}{.9,.9,.9}
\definecolor{darkgray}{rgb}{.4,.4,.4}
\definecolor{purple}{rgb}{0.65, 0.12, 0.82}
@filipemeneses
filipemeneses / fatec-siga-get-nome.js
Created Dec 13, 2017
Login e raspagem do nome no SIGA da Fatec
View fatec-siga-get-nome.js
const request = require('request-promise-native')
const cheerio = require('cheerio')
const login = ({user, pass}) => {
let options = {
method: 'POST',
uri: 'https://siga.cps.sp.gov.br/aluno/login.aspx',
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36',
'Content-Type': 'application/x-www-form-urlencoded',
'Origin': 'https://siga.cps.sp.gov.br'
@filipemeneses
filipemeneses / bash
Created May 28, 2018
Convert GeoJSON file into Highcharts map file
View bash
echo "Highcharts.maps[\"countries/br/br-ac\"] = $(cat mesoregions-ac-12.json)" > highmaps.br-ac.js
@filipemeneses
filipemeneses / piskelToPixelArt.js
Last active Oct 22, 2017
Convert Piskel frames to pixel-art pattern
View piskelToPixelArt.js
Array.prototype.concat.apply([], Array(pskl.app.piskelController.getFrameCount())).map((_, index) => {
let palette = {}
let paletteIndex = 97
let art = []
pskl.utils.LayerUtils.mergeFrameAt(pskl.app.piskelController.getLayers(), index).forEachPixel((pixel, col, row) => {
if (!art[row]) art[row] = []
if (!pixel) {
art[row][col] = ' '
return
@filipemeneses
filipemeneses / Merge_latex_files.py
Last active Mar 9, 2017
Merge Latex files while working in individual files
View Merge_latex_files.py
import re
def file_get_contents(filename):
with open(filename) as f:
return f.read()
def file_put_contents(filename, data):
with open(filename, 'w') as f:
f.write(data)
f.close()
View Rename files inside folders
#rename exercise-00.go to l00e00.go
i=0
for d in */ ; do
cd $d
c=$(printf %02d $i)
mv exercise-${c}.sh l00e${c}.sh
cd ../
((i = i + 1))
done
You can’t perform that action at this time.