Skip to content

Instantly share code, notes, and snippets.

View lopezator's full-sized avatar
🐐
you have goat to be kidding me

David Lobe lopezator

🐐
you have goat to be kidding me
View GitHub Profile
@afirth
afirth / github_subpath_download.sh
Created January 26, 2019 14:31
save a subpath of a github repository
#!/usr/bin/env bash
set -eux -o pipefail
tarflags=--strip-components=2
# --wildcards required on linux but not osx
if [ "$(uname)" == "Linux" ]; then
tarflags+=--wildcards
fi
@chronon
chronon / ext.txt
Created February 18, 2017 15:38
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@sdiaz
sdiaz / README.md
Last active April 19, 2016 15:33 — forked from tjamps/README.md
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active December 12, 2023 17:47
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@campoy
campoy / letitfail.go
Last active January 6, 2024 07:26
This example shows how to have a set of goroutines running concurrently and processing requests. Panics from goroutines are recovered and the worker is restarted. You can download it and run it directly using `go run letitfail.go`
package main
import (
"bufio"
"fmt"
"os"
"time"
)
const numWorkers = 3
@raelgc
raelgc / Email Server (Linux, Unix, Mac).md
Last active April 8, 2024 06:01
Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@nitinhayaran
nitinhayaran / dump_for_mysql.py
Created December 24, 2011 11:02
Quick easy way to migrate SQLite3 to MySQL
#!/usr/bin/env python
"""
sqlite3 sample.db .dump | python dump_for_mysql.py > dump.sql
cat sqllite.sql | python dump_for_mysql.py > dump.sql
"""
import re
import fileinput
def this_line_is_useless(line):