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
<?hh // strict | |
$m = Map { | |
0 => 'one', | |
1 => 'two', | |
2 => 'three', | |
3 => 'four', | |
4 => 'five', | |
}; |
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
<?hh // strict | |
namespace Hack\UserDocumentation\TypeChecker\Modes\Examples\CallIntoDecl; | |
require __DIR__ . '/decl.inc.php'; | |
// This actually makes the call to calling_into_decl() since we cannot have | |
// top level functions in strict mode | |
require __DIR__ . '/main-function.inc.php'; | |
// use \Hack\UserDocumentation\TypeChecker\Modes\Examples\Decl as Decl; |
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
guides/hack/25-typechecker/05-modes-examples/call-into-decl.php:16:10,22: Unbound name (typing): Hack\UserDocumentation\TypeChecker\Modes\Examples\CallIntoDecl\Decl\php_func (Typing[4107]) | |
guides/hack/25-typechecker/05-modes-examples/call-into-decl.php:16:10,22: Unbound name: Hack\UserDocumentation\TypeChecker\Modes\Examples\CallIntoDecl\Decl\php_func (a global constant) (Naming[2049]) | |
guides/hack/25-typechecker/05-modes-examples/call-into-decl.php:16:10,22: Unbound name: Hack\UserDocumentation\TypeChecker\Modes\Examples\CallIntoDecl\Decl\php_func (a global function) (Naming[2049]) |
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
// You can use this script to generate xall.js like so: | |
// node unidecode-concat.js > xall.js | |
var xfiles = require('require-all')({ | |
dirname : __dirname + '/data/', | |
filter : /x(.*?)\.js$/, | |
excludeDirs : /^\.(git|svn)$/ | |
}); | |
process.stdout.write('module.exports = '); |
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
//Change 'Post' to the name of your class | |
Parse.Cloud.beforeSave('Post', function(request, response) { | |
//Change 'file' to the name of the column containing the image | |
var imageUrl = request.object.get('file').url(); | |
Parse.Cloud.httpRequest({ | |
url: imageUrl | |
}).then(function(httpResponse) { | |
if (!(httpResponse.buffer && httpResponse.buffer.length)) { | |
response.error('Uploaded image was empty or invalid'); | |
} else { |
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
#!/bin/sh | |
cd /var/www/dokuwiki/data && git add . && git add -u && git commit -a -m "Content update `date +'%H:%M %d/%m/%Y %Z'`" && git push origin master |
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
# Generate 7-char string and copy to pasteboard (e.g. "ff757eb" and "41d0a9a") | |
head -c 10 /dev/urandom | shasum | head -c 7 | pbcopy | |
# Use date as input | |
date | shasum | head -c 7 | pbcopy |