Skip to content

Instantly share code, notes, and snippets.

@beingsane
beingsane / github_clone_all_repos_of_org.sh
Created November 7, 2022 14:36 — forked from bjuretko/github_clone_all_repos_of_org.sh
Checkout all repos from an Organization/Group on GitHub / GitLab
curl -Ss -u <username> --header "X-GitHub-OTP: <OTP from your SMS or App>"  https://api.github.com/orgs/<orgname>/repos | \
jq -a -r ".[].ssh_url" | \
xargs -I "{}" git clone "{}"`
@beingsane
beingsane / git-update-fork.sh
Created April 27, 2022 17:16 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
import { useEffect, useState } from 'react';
import { Flex, Select, Box, Text, Input, Spinner, Icon, Button } from '@chakra-ui/react';
import { useRouter } from 'next/router';
import { MdCancel } from 'react-icons/md';
import Image from 'next/image';
import { filterData, getFilterValues } from '../utils/filterData';
import { baseUrl, fetchApi } from '../utils/fetchApi';
import noresult from '../assets/images/noresult.svg';
@beingsane
beingsane / exceljs.d.ts
Created August 10, 2021 19:46 — forked from Rycochet/exceljs.d.ts
Typescript definitions for ExcelJS
/*
* Type definitions for ExcelJS
* Project: https://github.com/guyonroche/exceljs
* Definitions by: Rycochet https://github.com/Rycochet
*
* This is a WIP
*/
declare namespace ExcelJS {
type Zip = any;
@beingsane
beingsane / GoogleDorking.md
Created July 19, 2021 14:47 — forked from sundowndev/GoogleDorking.md
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@beingsane
beingsane / cascade_delete_with_procedures_postgres.sql
Created October 14, 2020 18:42 — forked from maykbrito/cascade_delete_with_procedures_postgres.sql
Delete Cascade with Trigger and Procedures PostgreSQL.
CREATE TABLE "users" (
"id" SERIAL PRIMARY KEY,
"name" TEXT NOT NULL
);
CREATE TABLE "files" (
"id" SERIAL PRIMARY KEY,
"name" text NOT NULL
);

How to dump and import PostgreSQL database

Below some step by step with bash functions example on how to dump your database and restore it to your db server.

✅ Dump the source database to a file.

function pgDumpDB() {
    echo 'Type db user: ' && read DBUSER;
    echo 'Type db name: ' && read DBNAME;
 pg_dump -U $DBNAME -O $DBNAME $DBNAME.sql 
@beingsane
beingsane / argv.json
Created August 21, 2020 17:05 — forked from guilhermerodz/argv.json
VSCode setup
// This configuration file allows you to pass permanent command line arguments to VS Code.
// Only a subset of arguments is currently supported to reduce the likelyhood of breaking
// the installation.
//
// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT
//
// NOTE: Changing this file requires a restart of VS Code.
{
// Use software rendering instead of hardware accelerated rendering.
// This can help in cases where you see rendering issues in VS Code.
#!/bin/sh
for f in *.mp4;
do
HandBrakeCLI -i "$f" -o "${f}.m4v" --preset="480p";
done
use GuzzleHttp\Client;
class yourController extends Controller {
public function saveApiData()
{
$client = new Client();
$res = $client->request('POST', 'https://url_to_the_api', [
'form_params' => [