This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Lightsaver G80-1800 style", | |
"author": "Damien Guard", | |
"background": { | |
"name": "Steel brushed dark", | |
"style": "background-image: url('/bg/metal/iron_texture1745.jpg');" | |
}, | |
"switchMount": "cherry", | |
"switchBrand": "cherry", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"backcolor": "#000000", | |
"name": "Compaq G80-1800", | |
"author": "Damien Guard", | |
"background": { | |
"name": "ABS WFK", | |
"style": "background-image: url('/bg/plastic/abs-wfk.jpg');" | |
}, | |
"switchMount": "cherry", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
$proxyKey = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer -ErrorAction Stop).ProxyServer | |
foreach($proxy in $proxyKey.Split(';')) { | |
$parts = $proxy.Split('=') | |
switch ($parts[0]) { | |
'http' { iex "npm config set proxy http://$parts[1]"; break } | |
'https' { iex "npm config set https-proxy http://$parts[1]"; break } | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.getProxyServers = (callback) => { | |
try { | |
new Registry('\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings') | |
.get('ProxySever', (err, val) => { | |
callback(err, err ? undefined || Object.assign({}, ...val.split(';').map(v => v.split('=')).map(v => ({[v[0]]: v[1]})))) | |
}) | |
} catch (err) { | |
callback(err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am damieng on github. | |
* I am damieng (https://keybase.io/damieng) on keybase. | |
* I have a public key ASA8deTgucv6MkZXIKGoqPTL9-Tw1C1HZPVR_iOyfEsQfgo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import fs from 'fs'; | |
export default async function download(sourceUrl: string, targetFile: string, progressCallback: ?ByteProgressCallback, length: ?number): Promise<void> { | |
const request = new Request(sourceUrl, { | |
headers: new Headers({'Content-Type': 'application/octet-stream'}) | |
}); | |
const response = await fetch(request); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import fs from 'fs'; | |
// Public: Download a file and store it on a file system using streaming with appropriate progress callback. | |
// | |
// * `sourceUrl` Url to download from. | |
// * `targetFile` File path to save to. | |
// * `progressCallback` Callback function that will be given a {ByteProgressCallback} object containing | |
// both bytesDone and percent. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/backup | |
rm * | |
_today=$(date +"%Y%m%d") | |
tar -c --xz -f $_today-nginx-config-dedicated.tar.xz -C /etc nginx | |
tar -c --xz -f $_today-damieng-files.tar.xz -C /var/www damieng | |
mysqldump wpDamieng | xz -9 -c - > $_today-damieng-wordpress-db.xz | |
cp ../*.sh . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "Microsoft.WindowsAzure.Storage" | |
using Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Table; | |
using System.Net; | |
public static async Task<object> Run(HttpRequestMessage req, TraceWriter log) | |
{ | |
var page = req.GetQueryNameValuePairs().FirstOrDefault(kv => string.Compare(kv.Key, "page", true) == 0); | |
if (String.IsNullOrEmpty(page.Value)) return req.CreateResponse(HttpStatusCode.BadRequest); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern alias b; | |
using System; | |
class A { public dictionary<int, String> func(int a) { } } | |
struct hi { byte q; int a = /* */ 1; char c = 'c'; } | |
void A() { } | |
#if ABC // Testing | |
#endif | |
/* Mult-line | |
comment */ | |
public abstract class Outside { } |