Skip to content

Instantly share code, notes, and snippets.

@ys-qb
ys-qb / agile.md
Last active July 11, 2017 01:52
agile@startup
@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 / .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 / 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 / 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 / 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.",