Skip to content

Instantly share code, notes, and snippets.

@ljm42
ljm42 / PhotoImport.sh
Last active July 5, 2024 10:44
unRAID - automatically move photos to array
#!/bin/bash
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
## Usage (after configuration):
## 1. Insert camera's memory card into a USB port on your unRAID system
## 2. The system will automatically move (or copy) any images/videos from the memory card to the array
## If jhead was installed, it will automatically rotate images according to the exif data
## 3. Wait for the imperial theme to play, then remove the memory card
## Preparation:
@tracker1
tracker1 / 01-directory-structure.md
Last active July 25, 2024 14:04
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@macbre
macbre / chrome-first-paint.js
Created October 21, 2014 20:40
Chrome's first paint timing
// first paint in chrome from https://github.com/addyosmani/timing.js
var hasFirstPaint = 0;
if (window.chrome && window.chrome.loadTimes) {
var paint = window.chrome.loadTimes().firstPaintTime * 1000;
var firstPaint = paint - (window.chrome.loadTimes().startLoadTime*1000);
var firstPaintLeft = (firstPaint / loaded)*100;
hasFirstPaint = 1;
}
@czy88840616
czy88840616 / proxy.js
Last active December 20, 2015 04:29
两种http代理方式的实现
/**
* @fileoverview simple project assets proxy
* @author 张挺 <zhangting@taobao.com>
*/
var fs = require('fs'),
path = require('path'),
http = require('http'),
https = require('https'),
url = require('url'),
httpProxy = require('http-proxy');