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) {
this.cacheable()
this.async()
var self = this
@johanndt
johanndt / upgrade-postgres-9.3-to-9.5.md
Last active Jan 11, 2020 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu
View upgrade-postgres-9.3-to-9.5.md

TL;DR

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
#optional
> /usr/syno/etc/rc.d/S97apache-sys.sh start
> /usr/syno/etc/rc.d/S95sshd.sh start
View publishing-an-npm-package.md

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
elwinar / clip
Created Feb 13, 2015
Shortcut to pipe from and to clipboard using xclip
View clip
#!/bin/bash
# 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
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>
<html>
<head>
<meta charset="UTF-8">
<title>True Trello Printer</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<style>
body{margin:15%;}
.panel-body{
@davewongillies
davewongillies / Serving Django apps behind SSL with Nginx.md
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 Nginx.md

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
neara / forms.py
Last active May 31, 2020
Django Class Based Views and Inline Formset Example
View forms.py
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
shawndumas / .gitconfig
Created Aug 5, 2013
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
View .gitconfig
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@dustinfarris
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.