Skip to content

Instantly share code, notes, and snippets.

View teles's full-sized avatar
👨‍🚀
"A inteligência é o mais pobre dos atributos humanos" - Tom Jobim

Teles teles

👨‍🚀
"A inteligência é o mais pobre dos atributos humanos" - Tom Jobim
View GitHub Profile
@tgmarinho
tgmarinho / Recursos.md
Created July 16, 2020 16:15
Melhores sites para baixar imagens gratuitas e outros recursos
@lgvalle
lgvalle / firebase-scraping.js
Last active September 23, 2021 01:17
Firebase cloud function to scrap html and send the content with push notifications
const rp = require('request-promise');
const cheerio = require('cheerio');
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
const db = admin.firestore();
exports.allyPallyFarmersMarket = functions.https.onRequest((request, response) => {
@fmasanori
fmasanori / Pet Names.py
Last active November 15, 2017 21:44
Lista de nomes de Pets
import requests
from bs4 import BeautifulSoup as bs
import string
pets = []
for pet in ('Gatos', 'Caes'):
for letra in string.ascii_uppercase:
for k in (1, 2, 3):
u = 'https://www.bayerpet.com.br/%s/lista-nomes/%s%s' %(pet, letra, str(k))
p = requests.get(u)
@JamieMason
JamieMason / es6-compose.md
Last active May 17, 2022 17:38
ES6 JavaScript compose function

ES6 JavaScript Compose Function

Definition

const compose = (...fns) =>
  fns.reduceRight((prevFn, nextFn) =>
    (...args) => nextFn(prevFn(...args)),
    value => value
 );
@Phlow
Phlow / pagination-collection.liquid
Last active October 13, 2023 03:10
If you need pagination for a collection in a Jekyll theme, you can use the following Liquid logic which works also on Github pages
{% comment %}
#
# I modified the original code from http://anjesh.github.io/2015/01/25/collection-pagination-working-github-pages/
#
# Make a collection in _config.yml and create the folder _your_collection in your root.
#
# collections:
# your_collection:
# output: true
# permalink: /:collection/:title/
@aerohub
aerohub / _config.yml
Last active January 2, 2021 20:10
Hexo tag_map and category_map parameters in _config.yml file
# http://blog.konstantinpavlov.net/2015/01/17/hexo-useful-tips/
# If you want your tags and categories on your language and the URLs still look nice in ASCII,
# you may use tag_map and category_map parameters in _config.yml file of your blog.
# You can even set one URL prefix for two different tags.
tag_map:
tag1: supertag
по-русски: in-russian
fun: fun and jokes
jokes: fun and jokes
@jamescmartinez
jamescmartinez / slack_delete.rb
Last active May 28, 2024 15:00
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 19, 2024 11:04
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@dmarcelino
dmarcelino / angular.adsense.js
Created May 22, 2015 11:07
Angular adsense example that shows ad more than 3 times
'use strict';
var adSenseTpl = '<div id="adsenses-ad-1"><ins class="adsbygoogle"' +
'style="display:inline-block;width:336px;height:280px"' +
'data-ad-client="ca-pub-000000000000000000"' +
'data-ad-slot="00000000000"></ins></div>';
var adsenseAd1;
angular.module('MyApp')
@Spencer-Easton
Spencer-Easton / XMLtoJSON
Created April 8, 2015 17:30
Script to convert XML to JSON using XmlService - Originaly published in a +Google Apps Script community thread by Eric Koleda
/**
* Converts an XML string to a JSON object, using logic similar to the
* sunset method Xml.parse().
* @param {string} xml The XML to parse.
* @returns {Object} The parsed XML.
*/
function xmlToJson(xml) {
var doc = XmlService.parse(xml);
var result = {};
var root = doc.getRootElement();