Skip to content

Instantly share code, notes, and snippets.

View dario-valles's full-sized avatar

Darío Vallés dario-valles

View GitHub Profile
@dario-valles
dario-valles / ngix-to-vercel-redirects.js
Last active March 28, 2022 09:15
Ngix to Vercel redirects
const { readFileSync, writeFileSync, appendFileSync } = require("fs");
const ngixFile = "ngix-redirect-file.conf";
const jsonRedirectFile = "vercel.json";
ngixToVercelRedirect = (ngix) => {
const ngixParts = ngix.split(" ");
const ngixPath = ngixParts[1];
const ngixDestination = ngixParts[2];
const ngixStatusCode = ngixParts[3];
@dario-valles
dario-valles / Useful-curl-commands.md
Last active May 12, 2021 07:21
Useful curl commands

Loading speed using curl:

foo@bar:~$ curl -s -w 'Testing Website Response Time for :%{url_effective}\n\nLookup <br />Time:\t\t%{time_namelookup}\nConnect
Time:\t\t%{time_connect}\nAppCon Time:\t\t%{time_appconnect}\nRedirect 
Time:\t\t%{time_redirect}\nPre-transfer Time:\t%{time_pretransfer}\nStart-transfer 
Time:\t%{time_starttransfer}\n\nTotal Time:\t\t%{time_total}\n' -o /dev/null ADDRESS
@dario-valles
dario-valles / push.sh
Created December 2, 2020 10:18
This script pull changes on current branch, pushes your changes, checks if there are some pending CI tasks and pull changes when tasks are done (gh client needed)
#!/bin/bash
currentBranch=`git branch --show-current`
currentBranch="${currentBranch}"
echo "🛬 Pulling changes from current ${currentBranch}"
git pull origin $currentBranch
echo "🛫 Pushing changes from your current ${currentBranch}"
git push origin $currentBranch
ghCommand=`gh api /repos/:owner/:repo/commits/:branch/status | python -c 'import json, sys; print(json.loads(sys.stdin.read())["state"]);'`
import 'dart:async';
class Cake {}
class Order {
String type;
Order(this.type);
}