Skip to content

Instantly share code, notes, and snippets.

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

Braulio Soncco soncco

🏠
Working from home
View GitHub Profile
// communications
{
_id: ObjectId,
type: "email" | "sms" | "push" | "chat",
direction: "outbound" | "inbound",
threadId: ObjectId,
originalNotificationId: ObjectId,
sender: {
userId: ObjectId,
email: "[email protected]",
@soncco
soncco / views.py
Created May 17, 2024 21:13
Crear expediente
from django.shortcuts import render
from django.http import HttpResponseRedirect
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework import status
from datetime import datetime
from tramite.models import Expediente, DestinoDocumento, EstadoDestinoDocumento
um gt 139
prd gt 247810
sudo npm cache clean -f
sudo npm install -g n
sudo n 6.11.0
create user 'user'@'localhost' IDENTIFIED BY 'pass';
GRANT ALL PRIVILEGES ON db.* TO 'user'@'localhost';
cd public/sitio
drush dl drupal
# Descargará una carpeta algo asi drupal-7.42
cp -pax drupal-7.42/. web
cd web
drush updb -y
@soncco
soncco / hack.coffee
Created February 4, 2016 13:44
Bootstrap Drupal hardcode hack for search
# Search Hack.
$search = $('#search-block-form', context)
$search
.removeAttr('id')
$first = $search.find('div:first-child')
$($first.html()).appendTo($search)
$first.remove()
cd sites/all/default
mkdir files
su foreign
sudo chown -R www-data:www-data files
exit
cp default.settings.php settings.php
chmod 777 settings.php
function epsacrop_element_info_alter(&$type) {
$type['managed_file']['#process'][] = 'epsacrop_element_process';
if (module_exists('multiupload_filefield_widget')) {
$type['mfw_managed_file']['#process'][] = 'epsacrop_element_process';
}
if (module_exists('media')) {
$type['media']['#process'][] = 'epsacrop_element_process';
}
}
@soncco
soncco / shell.sh
Created June 24, 2015 17:01
uwsgi and django
sudo apt-get install uwsgi uwsgi-plugin-python
cd /etc/uwsgi/apps-available
sudo vim site.ini
# View site.ini
cd ..
cd apps-enabled
ln -s ../apps-available/site.ini
sudo service uwsgi restart
cd /etc/nginx/sites-available
sudo vim site.conf