Skip to content

Instantly share code, notes, and snippets.

Dário dmarcelino

Block or report user

Report or block dmarcelino

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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 Aug 8, 2019 — 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:

@mathiasrw
mathiasrw / True Trello Printer
Last active Sep 19, 2019
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 Sep 5, 2019 — 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 Sep 8, 2019
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
@allybee
allybee / target_blank.js
Last active Sep 4, 2019
Add target="_blank" to external links with pure JavaScript.
View target_blank.js
function targetBlank() {
// remove subdomain of current site's url and setup regex
var internal = location.host.replace("www.", "");
internal = new RegExp(internal, "i");
var a = document.getElementsByTagName('a'); // then, grab every link on the page
for (var i = 0; i < a.length; i++) {
var href = a[i].host; // set the host of each link
if( !internal.test(href) ) { // make sure the href doesn't contain current site's host
a[i].setAttribute('target', '_blank'); // if it doesn't, set attributes
You can’t perform that action at this time.