Skip to content

Instantly share code, notes, and snippets.

@ys-qb
ys-qb / gist:5403696
Created April 17, 2013 11:59
https webdav server using jsDAV
"use strict";
var https = require('https');
var fs = require('fs');
var auth = require('http-auth')
var jsDAV = require("jsDav/lib/jsdav");
jsDAV.debugMode = false;
var jsDAV_Locks_Backend_FS = require("jsDav/lib/DAV/plugins/locks/fs");
var basic = auth({
authRealm : "Private area.",
@ys-qb
ys-qb / startup-app.sh
Last active December 18, 2015 15:19 — forked from touv/startup-app.sh
#!/bin/sh
##3.5...10...15...20...25...30...35...40...45...50...55...60...65...70...75...80
##
## Debian / Linux / Ubuntu / LSB
## Startup script for Express / Node.js application with the forever module
##
##
## A modification of "init.d.lsb.ex" by Nicolas Thouvenin
##
##
@ys-qb
ys-qb / app.js
Created May 11, 2014 12:55
override web files depending on site path
var fs = require('fs');
var express = require('express');
var app = express();
var path = require('path');
app.get('/:site/:file', function(req, res, next){
var filePath = path.join(__dirname + '/sites' , req.params.site, req.params.file);
if (fs.existsSync(filePath)){
res.sendfile(filePath);
@ys-qb
ys-qb / .sleep
Last active November 27, 2016 05:06
jetdrive
#!/bin/sh
if pgrep Dropbox > /dev/null; then
osascript -e 'tell application "Dropbox" to quit'
fi
diskutil unmountDisk /dev/disk2 > /dev/null 2>&1
@ys-qb
ys-qb / 0_reuse_code.js
Created January 15, 2017 23:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ys-qb
ys-qb / agile.md
Last active July 11, 2017 01:52
agile@startup
@ys-qb
ys-qb / hacluster..md
Created April 4, 2017 09:37
HA cluster

HA


SPOF

A single point of failure (SPOF) is a part of a system that, if it fails, will stop the entire system from working.

source: wikipedia
@ys-qb
ys-qb / wordpress.md
Last active October 19, 2017 08:40
gitple short description in english

Gitple is a cloud application available online at https://gitple.io With Giple Chat, your visitors can talk with you directly at your homepage or mobile app. Many productivity features are ready for you to handle multple conversations at the same time.

After a few clicks, you can add Gitple chat widget to your homepage. Diverse settings are available at Gitple Workspace application. You can change the widget's looks, allowing from either logined user or not etc.

@ys-qb
ys-qb / .bash_profile
Last active October 23, 2017 00:14
git prompt
if [ -f ~/.bash-git-prompt/gitprompt.sh ]; then
GIT_PROMPT_ONLY_IN_REPO=1
GIT_PROMPT_THEME=Custom # use custom theme specified in file GIT_PROMPT_THEME_FILE (default ~/.git-prompt-colors.sh)
source ~/.bash-git-prompt/gitprompt.sh
fi
@ys-qb
ys-qb / .bashrc
Last active October 22, 2017 01:47
git prompt : branch only
# see https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt
# Terminal colours (after installing GNU coreutils)
NM="\[\033[0;38m\]" # means no background and white lines
GR="\[\033[0;90m\]" # dark grey
HI="\[\033[0;37m\]" # change this for letter colors
HII="\[\033[0;31m\]" # change this for letter colors
SI="\[\033[0;33m\]" # this is for the current directory
IN="\[\033[0m\]"