Skip to content

Instantly share code, notes, and snippets.

View bran921007's full-sized avatar
🏠
Working from home

Fran Perez bran921007

🏠
Working from home
View GitHub Profile
@bran921007
bran921007 / get.js
Created October 8, 2019 02:55 — forked from rafaelstz/get.js
AJAX GET and POST with pure Javascript
// Exemplo de requisiΓ§Γ£o GET
var ajax = new XMLHttpRequest();
// Seta tipo de requisiΓ§Γ£o e URL com os parΓ’metros
ajax.open("GET", "minha-url-api.com/?name=Henry&lastname=Ford", true);
// Envia a requisiΓ§Γ£o
ajax.send();
// Cria um evento para receber o retorno.
@bran921007
bran921007 / instagram_count_to_googe_sheet.js
Created October 8, 2019 17:39 — forked from nickboyce/instagram_count_to_googe_sheet.js
Track your Instagram followers over time with Google SheetsΒ Scripts
// Thank you to @juliendev for his script (updated here with minor cosmetic changes)
// https://gist.github.com/JulienDev/df5a3b66e899c224fa1b2dc90acfa2ae
// Your sheet name in the document
var sheetName = "Sheet1";
// Your instagram user id
var user_id = ""; //find your id here : https://codeofaninja.com/tools/find-instagram-user-id
var instagram_base_url = "https://www.instagram.com/graphql/query/";
var following = "?query_hash=58712303d941c6855d4e888c5f0cd22f&variables=%7B%22id%22%3A%22" + user_id + "%22%2C%22first%22%3A24%7D"
function initFollowerCount() {
// sets up sheet names and Instagram accounts
insertFollowerCount("sheet1", "kingandmcgaw");
insertFollowerCount("sheet2", "nickboyce");
}
function insertFollowerCount(sheetName, instagramAccountName) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName(sheetName);
sheet.appendRow([Utilities.formatDate(new Date(), "GMT", "yyyy-MM-dd"), getInstagramFollowerCount(instagramAccountName)]);
@bran921007
bran921007 / gist:df7a43d49dc976dec7535b44a1bea625
Created October 12, 2019 11:06 — forked from beezly/gist:4250079
Google Script Spreadsheet function to iterate over all cells and insert the value 0 if the cell is blank
function zeroCells() {
var ss=SpreadsheetApp.getActiveSpreadsheet();
var sheet=ss.getSheets()[0];
var selection=sheet.getDataRange();
var columns=selection.getNumColumns();
var rows=selection.getNumRows();
for (var column=1; column < columns; column++) {
for (var row=1; row < rows; row++) {
var cell=selection.getCell(row,column);
if (cell.isBlank()) {
@bran921007
bran921007 / scrape.py
Created November 3, 2019 00:05
Web Scraping for Email Addresses and Phone numbers using Python
# Small Python Script to scrape websites for
# email addresses and phone numbers(not a very great RE)
# Author: Dhruv Baldawa (@dhruvbaldawa on twitter)
# Github: http://www.github.com/dhruvbaldawa
import urllib,re
f = urllib.urlopen("http://www.example.com")
s = f.read()
re.findall(r"\+\d{2}\s?0?\d{10}",s)
re.findall(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}",s)
@bran921007
bran921007 / Amazon product price scraper
Created November 8, 2019 03:31 — forked from erajanraja24/Amazon product price scraper
Amazon product price Scraper
function scraper() {
/* Create two sheets with name "Settings" and "Scraper".Put your API key in the Setting tab B1 and put your ASIN list
in the Scraper tab*/
var apiKey = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Settings").getRange(1, 2).getValue();
var scraperSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Scraper")
var lrow = scraperSheet.getLastRow();
@bran921007
bran921007 / PewPewPew.php
Created May 10, 2020 21:45 — forked from ericlbarnes/PewPewPew.php
Hold up... Wait a minute... It's a Laravel Chopper
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class PewPewPew extends Command
{
protected $signature = 'pewpewpew';
protected $description = 'Command description';
<?php
namespace App\Services;
use App\Post;
class Slug
{
/**
* @param $title
@bran921007
bran921007 / laravel-loop-through-old-flash.php
Created June 22, 2020 03:40 — forked from whoisryosuke/laravel-loop-through-old-flash.php
Laravel - Get old form input values for array-based input
<?php
@if(old('uid_tag'))
@foreach(old('uid_tag') as $product)
<input type="text" name="uid_tag[]" value="{{ old('uid_tag')[$loop->index] }}" size="30" />
<textarea
placeholder="Include weight or count"
name="product_description[]"
cols="45"
rows="1"
value="{{ old('product_description')[$loop->index] }}"
@bran921007
bran921007 / youtube_id_regex.php
Created July 23, 2020 23:31 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ