Skip to content

Instantly share code, notes, and snippets.

View hello-alf's full-sized avatar
Working from home

Luis Alfredo Quispe Villca hello-alf

Working from home
  • La Paz, Bolivia
  • 05:55 (UTC -04:00)
View GitHub Profile
1. create a folder called Backups
mkdir Backups
2. Login as postgres user through console
sudo -su postgres
3. execute the following comand
(REPLACE DB_NAME with the database that you want to extract data)
NOTE: the content of backup_script is:
# Instalador de brew
/bin/bash -c "$(curl -fsSL"
brew update
brew install nginx
# Comando para iniciar el server
launchctl load /usr/local/cellar/nginx/1.19.2/homebrew.mxcl.nginx.plist
# Comando para detener servicio+
launchctl unload /usr/local/cellar/nginx/1.19.2/homebrew.mxcl.nginx.plist
server {
listen 80;
listen [::]:80;
root /var/www/;
index index.html index.htm index.nginx-debian.html;
location / {
let res = []
function greedyChange(coinSet, n, amount) {
if (n < 0) {
'Lo sentimos no contamos con efectivo suficiente para darte el monto que necesitas'
if (amount === 0) {
# particion que hace ordenamiento usando el pivote
#low es el indice mas bajo
#high es el indice mas algo
def particion(arr, low, high):
i = (low-1)
# pivot es el valor medio que necesitamos
pivot = arr[high]
for j in range(low, high):
hello-alf /
Created June 26, 2016 02:30 — forked from SeanHayes/
TastyPie: Return 400 Bad Request when deserialization fails
from tastypie import http
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.resources import ModelResource
class CustomModelResource(ModelResource):
def deserialize(self, request, data, format='application/json'):
return super(CustomModelResource, self).deserialize(request, data, format=format)
except Exception as e:
# if an exception occurred here it must be due to deserialization
hello-alf / precise_round.js
Created October 1, 2015 16:33 — forked from a-r-m-i-n/precise_round.js
How to round correctly in JavaScript
function sign(num) {
// IE does not support method sign here
if (typeof Math.sign === 'undefined') {
if (num > 0) {
return 1;
if (num < 0) {
return -1;
return 0;