I hereby claim:
- I am peterkc on github.
- I am peterkc (https://keybase.io/peterkc) on keybase.
- I have a public key whose fingerprint is 5521 24A1 2988 F388 A8D1 EFB3 40F8 0F23 FACF 3553
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env node | |
| var fs = require('fs'); | |
| var async = require('async'); | |
| async.parallel([ | |
| copyFile.bind(null, 'resources/file1.txt', 'resources/file1_copy.txt'), | |
| copyFile.bind(null, 'resources/file2.txt', 'resources/file2_copy.txt'), | |
| copyFile.bind(null, 'resources/file3.txt', 'resources/file3_copy.txt') | |
| ], function (err, results) { |
| CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json) | |
| RETURNS json | |
| LANGUAGE sql | |
| AS $$ | |
| SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json | |
| FROM ( | |
| SELECT * FROM json_each(data) | |
| UNION ALL | |
| SELECT * FROM json_each(insert_data) | |
| ) t; |
There are two reasons for that:
By having an function argument undefined (the name actually does not matter) which you don't pass a parameter to, you make sure you have a variable which really is undefined so you can test "undefinedness" against this variable.
Btw. the safest method to test for undefined is: typeof ( var ) === 'undefined'
EDIT: With adoption of EcmaScript 5, undefined, NaN and Infinity are now readonly in all modern browsers - of course with the exception of Internet Explorer up to Version 9 :(. So this is not necessary anymore, however:
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
I see this error when I try to suspend an Ubuntu 10 guest in Fusion:
The request to Suspend this virtual machine failed because the corresponding VMware Tools script did not run successfully.
If you have configured a custom suspend script in this virtual machine, make sure that it contains no errors. Attempting the operation again will ignore the script failure. You can also submit a support request to report this issue.
As the dialog states, the second time you try to suspend the VM it ignores the non-zero return code of the script and it seems to work. But it's annoying.
The problem appears to not be VMware actually, but Ubuntu (or Ubuntu's service script). I tried to figure out where exactly Ubuntu's initctl configuration/scripts is broken to no avail but found a work-around that I'm happy with.
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| my ($previous_head, $current_head, $is_branch_checkout) = @ARGV; | |
| my ($is_on_facelift, $run_compass) = 0; | |
| if ($is_branch_checkout) { | |
| $is_on_facelift = `git branch | grep -e "^\*.*facelift"`; | |
| chomp $is_on_facelift; |