Skip to content

Instantly share code, notes, and snippets.

View patriciomg's full-sized avatar
🎖️
I may be slow to respond.

Don Pato patriciomg

🎖️
I may be slow to respond.
  • KK
  • Germany
View GitHub Profile
@khansensf
khansensf / TermTheme.scpt
Created February 1, 2012 01:09
Small script to rotate through themes in OSX Terminal Window. Great for discerning among many open windows/tabs
-- TermTheme.scpt
-- Ken Hansen 02/2012
-- Sets theme of current terminal window/tab
-----------------------
-- Arguments
-----------------------
-- If a theme name is provided on the command line then set to that
-- Example
-- osascript TermTheme.scpt Grass
@Atem18
Atem18 / gist:4696071
Last active April 19, 2024 11:18 — forked from evildmp/gist:3094281
Tutorial to seting up a django website in production.

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@postrational
postrational / gunicorn_start.bash
Last active April 4, 2024 12:48
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
@jakob-stoeck
jakob-stoeck / Copy as textile
Created October 29, 2013 17:52
Copies SequelPro results as a textile table to use it in Redmine or other textile-supported systems. To use, just copy it into your SequelPro Bundle Editor.
#!/usr/bin/php
<?php
$in = fopen('php://stdin', 'r');
$result=array();
$format='_.';
while($line=fgetcsv($in, 0, "\t")) {
$result[]='|'.$format.implode('|'.$format, $line).'|';
$format='';
}
fclose($in);
@drobune
drobune / gist:e03d64ef7ba02864781a
Created December 12, 2014 07:11
get only status code on curl
curl -LI mazgi.com -o /dev/null -w '%{http_code}\n' -s
# creating and testing permissions and test groups in django tests.
from django.contrib.auth.models import User, Permission, Group
from django.test import TestCase
from django.test import Client
class ExampleGroupPermissionsTests(TestCase):
def setUp(self):
#create permissions group
@briceburg
briceburg / Dockerfile.fails
Created March 30, 2016 22:17
docker - example adding www-data user to alpine images
FROM nginx:alpine
# stock verison from php:alpine image
# ensure www-data user exists
RUN set -x \
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data
# 82 is the standard uid/gid for "www-data" in Alpine
# http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2
@settermjd
settermjd / download-file-in-expressive.php
Last active July 25, 2022 01:25
Quick example of how to download/stream a file using Zend Expressive.
<?php
/**
* This is a quick example of how to stream a file to a client, likely a browser,
* using Zend Expressive. There are a lot of factors which it doesn't take in to
* account. But for the purposes of a quick intro, this should suffice.
*/
class ViewDocumentPageAction
{
protected function downloadFile()
{
@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
@denji
denji / README.md
Last active March 19, 2025 13:08 — forked from Cubixmeister/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000