Skip to content

Instantly share code, notes, and snippets.

View xgenvn's full-sized avatar

TuNA xgenvn

View GitHub Profile
@xgenvn
xgenvn / docker-compose.yml
Created November 15, 2017 07:15 — forked from puppybits/docker-compose.yml
sentry docker-compose
redis:
image: redis
postgres:
image: postgres
environment:
- POSTGRES_PASSWORD=sentry
- POSTGRES_USER=sentry
volumes:
- /var/lib/postgresql/data
@xgenvn
xgenvn / instruction.md
Created November 15, 2017 08:01
Setup sentry using docker
git clone https://github.com/getsentry/onpremise
cd onpremise
# https://docs.sentry.io/server/installation/docker/

make build
mkdir -p data/{sentry,postgres}    # Make our local database and sentry config directories.`
docker-compose run --rm web config generate-secret-key    # Generate a secret key.
@xgenvn
xgenvn / server.js
Created December 6, 2017 01:46 — forked from nicroto/server.js
NodeJS server for a single-page app with client navigation and no backend.
'use strict';
var http = require( "http" ),
pathUtils = require( "path" ),
express = require( "express" ),
app = express(),
PORT = process.env.PORT || 5000,
appDir = pathUtils.resolve( __dirname, "client" );
app.use( express.static( appDir ) );
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
@xgenvn
xgenvn / gist:078a51b3408803e3da83b0adc3412fe0
Created December 22, 2017 14:00
cmder handy shortcut
C-@ : set-mark A-& : tilde-expand
C-a : beginning-of-line A-* : insert-completions
C-b : backward-char A-- : digit-argument
C-c : ctrl-c A-. : yank-last-arg
C-d : delete-char A-0 : digit-argument
C-e : end-of-line A-1 : digit-argument
C-f : forward-char A-2 : digit-argument
C-g : abort A-3 : digit-argument
C-h : backward-delete-char A-4 : digit-argument
C-i : clink-completion-shim A-5 : digit-argument
@xgenvn
xgenvn / nonASCIItext.js
Created January 29, 2018 09:22 — forked from Ripley6811/nonASCIItext.js
Add non-ASCII text as images to jsPDF. Use for Chinese characters and more. If canvas can draw it, then it can be added to jsPDF.
/**
* Prints a line of non-ASCII text as a series of images.
* All doc.text methods can be replaced with this method.
* Works like doc.text but requires a fontsize (default is 10).
*
* Add function to jsPDF instance (do not overwrite doc.text):
* var doc = new jsPDF();
* doc.alttext = nonASCIItext;
*
* @param {Number} x Horizontal placement
@xgenvn
xgenvn / pkg.lst
Last active March 2, 2018 01:44
Arc-theme build dependencies
pkg-config
dh-autoreconf
libgtk-3-dev
libcurl4-openssl-dev
@xgenvn
xgenvn / scripts.sh
Created March 19, 2018 09:25
postfix for ssh login notification
sudo apt-get install -y mailutils postfix
sudo vim /etc/ssh/ssh_alert.sh
--- content ---
#!/bin/bash
# replace with sender's email address
sender="sender_address@some_mail.com"
# replace with recipient's email address
recipient="recipient_address@some_mail.com"
time=$(date)
@xgenvn
xgenvn / Ubuntu Setup Note.md
Last active December 24, 2018 03:23
UBUNTU setup
git
git-kraken
curl wget build-essential automake
i32 packages
arc-theme
gnome-tweaks
nodejs
postman
vscode
@xgenvn
xgenvn / server.js
Created March 26, 2018 08:52 — forked from ryanoglesby08/server.js
A node.js SPA server that serves static files and an index.html file for all other routes.
/*
Incredibly simple Node.js and Express application server for serving static assets.
Given as an example from the React Router documentation (along with examples
using nginx and Apache):
- https://github.com/ReactTraining/react-router/blob/master/docs/guides/Histories.md#browserhistory
*/
const express = require('express');
const path = require('path');