Skip to content

Instantly share code, notes, and snippets.

View JoseCage's full-sized avatar
:octocat:
Opensourcing

José Cage JoseCage

:octocat:
Opensourcing
View GitHub Profile

Time Travel Debugging

Time Travel refers to the ability to record a tab and later replay it ([WebReplay][wrr]). The technology is useful for local development, where you might want to:

  • pause and step forwards or backwards
  • pause and rewind to a prior state
  • rewind to the time a console message was logged
  • rewind to the time an element had a certain style or layout
  • rewind to the time a network asset loaded
@reulison
reulison / web-scraping-python.py
Last active April 25, 2024 13:05
Web Scraping com Python e BeautifulSoup
import urllib.request
from bs4 import BeautifulSoup
wiki = 'https://pt.wikipedia.org/wiki/Lista_de_capitais_do_Brasil_por_%C3%A1rea'
page = urllib.request.urlopen(wiki)
soup = BeautifulSoup(page, 'html.parser')
table = soup.find('table')
A=[]
B=[]
@freekmurze
freekmurze / Check.php
Last active February 28, 2021 02:54
Refactored Oh Dear! code
<?php
class Check
{
public function needsToRun(): bool
{
if (!$this->belongsToTeamOnActiveSubscriptionOrOnGenericTrial()) {
return false;
}
@meSingh
meSingh / JsonMiddleware.php
Last active July 11, 2022 09:19
If you are using laravel as api only, you might want to return JSON on every request, even on errors/exceptions. The easiest way to do so is using this middleware globally.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class JsonMiddleware
{
public function handle(Request $request, Closure $next)
@marckohlbrugge
marckohlbrugge / wip_graphql_demo.rb
Last active October 10, 2022 11:46
Ruby example of creating a todo and then completing it using wip.co graphql.
# NOTE: Be sure to set the API key further down in the code!
require "net/http"
require "uri"
require "json"
class WIP
def initialize(api_key:)
@api_key = api_key
end
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active December 3, 2024 21:48
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@alexellis
alexellis / readme.md
Last active June 13, 2018 15:01
Raspivid sync-up
  • Get mplayer on your laptop

https://mplayerosx.ch/#downloads

  • Find the ip of your RPi with ipconfig and note it down.

  • Run this on the RPi

$ raspivid -fps 20 -w 1280 -h 720 -t 0 -l -vf -o tcp://0.0.0.0:2222
@chuckrincon
chuckrincon / ConfigServiceProvider.php
Last active October 10, 2023 14:13
Load all your lumen config files painless.
<?php
namespace App\Providers;
use Illuminate\Support\Facades\App;
use Illuminate\Support\ServiceProvider;
use Illuminate\Contracts\Filesystem\FileNotFoundException;
class ConfigServiceProvider extends ServiceProvider
{
@mikaelhadler
mikaelhadler / .gitconfig
Created January 12, 2018 00:03
Alias graph for git cli : ]
[alias]
graph = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
@rochacbruno
rochacbruno / rochacbruno_open_source.md
Last active August 10, 2019 13:38
Contribute to Open Source Projects