Skip to content

Instantly share code, notes, and snippets.

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

Frank Yupanqui A. fyupanquia

🏠
Working from home
View GitHub Profile
@fyupanquia
fyupanquia / repo-reset.md
Created June 2, 2021 21:27 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
let index = 231
let interval = setInterval(function(){
var link = document.createElement('a')
link.setAttribute('href', `document.json`)
link.setAttribute('download', '')
link.setAttribute('target', '_blank')
link.click()
if(index==264) {
clearInterval(interval)
return
const axios = require("axios");
class CircuitBreaker {
constructor() {
this.states = {};
this.failureThreshold = 5;
this.cooldownPeriod = 10;
this.requestTimeout = 1;
}
@fyupanquia
fyupanquia / slugify.js
Created March 25, 2020 15:44 — forked from codeguy/slugify.js
Create slug from string in Javascript
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
@fyupanquia
fyupanquia / docker-php-ext-install.md
Created March 24, 2020 05:39 — forked from giansalex/docker-php-ext-install.md
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev