Skip to content

Instantly share code, notes, and snippets.

Dário dmarcelino

View GitHub Profile
View xgettext-loader.js
let child = require("child_process")
let source_map = require("source-map")
let SourceMapConsumer = source_map.SourceMapConsumer
let path = require("path")
var crypto = require('crypto');
module.exports = function(source, sourceMap) {
var self = this
johanndt /
Last active Jan 11, 2020 — forked from dideler/
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu


Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
View gist:8d0cfd1cab22598cb5d8
Sometimes after a hard reboot (power cut), if your synology cannot be logged in with DSM and it shows "System is getting ready. Please log in later" , please do these steps :
#Admin login via ssh
> synobootseq --set-boot-done
> synobootseq --is-ready
> /usr/syno/etc/rc.d/ start
> /usr/syno/etc/rc.d/ start

Publishing an NPM package

Here's what I do when I publish an NPM package.

1: Make sure you're up to date

I always like to check what's going on in a repo before I do anything:

elwinar / clip
Created Feb 13, 2015
Shortcut to pipe from and to clipboard using xclip
View clip
# Linux version
# Use this script to pipe in/out of the clipboard
# Usage: someapp | clip # Pipe someapp's output into clipboard
# clip | someapp # Pipe clipboard's content into someapp
if command -v xclip 1>/dev/null; then
if [[ -p /dev/stdin ]] ; then
mathiasrw / True Trello Printer
Last active Jun 20, 2020
Ever wanted to print your Trello board? Export as JSON and paste it into the code.
View True Trello Printer
<!DOCTYPE html>
<meta charset="UTF-8">
<title>True Trello Printer</title>
<link href="" rel="stylesheet">
davewongillies / Serving Django apps behind SSL with
Last active May 6, 2020 — forked from aj-justo/gist:3228782
Serving Django apps behind SSL with Nginx
View Serving Django apps behind SSL with

Configuring Nginx to serve SSL content is straight forward, once you have your certificate and key ready:

server { 
    listen 443 default ssl;
    root /path/to/source;
    server_name mydomain;

    ssl_certificate      /path/to/cert;
    ssl_certificate_key  /path/to/key;
neara /
Last active May 31, 2020
Django Class Based Views and Inline Formset Example
from django.forms import ModelForm
from django.forms.models import inlineformset_factory
from models import Sponsor, Sponsorship
class SponsorForm(ModelForm):
class Meta:
model = Sponsor
shawndumas / .gitconfig
Created Aug 5, 2013
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
View .gitconfig
prompt = false
keepBackup = false
keepTemporaries = false
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
dustinfarris / Sharing Django Users and Sessions Across Projects
Created Jul 26, 2013
This is a dated document and may be improved on.
View Sharing Django Users and Sessions Across Projects
# Sharing Django Users and Sessions Across Projects
By Dustin Farris on 22 Feb 2012
This document describes how to share users created using Django's auth system with other
Django projects. It is not a hack; it simply makes use of the database router and
middleware system that Django comes with out of the box.
## Introduction
You can’t perform that action at this time.