Skip to content

Instantly share code, notes, and snippets.

View davidfuhr's full-sized avatar

David Fuhr davidfuhr

  • esentri AG
  • Karlsruhe, Germany
View GitHub Profile
@davidfuhr
davidfuhr / settings.json
Last active September 10, 2018 06:57
Visual Studio Code User Settings
{
"editor.renderWhitespace": "all",
"editor.scrollBeyondLastLine": false,
"editor.wrappingIndent": "indent",
"files.autoSave": "onWindowChange",
"git.autofetch": true,
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.rendererType": "dom",
}
@davidfuhr
davidfuhr / copy-postgres-db.sh
Last active September 12, 2017 07:52
copy remote postgres db to localhost
echo 'localhost:5432:my_database:my_user:my_password' >> ~/.pgpass
chmod 0600 ~/.pgpass
ssh -C db.example.com 'echo my_password|pg_dump -h localhost -n my_schema -U my_remote_user -c my_remote_db' | psql -h localhost -U my_user my_database
@davidfuhr
davidfuhr / DateInterval.php
Last active November 3, 2016 12:28
DateInterval Doctrine Type and Symfony Validator Constraint
<?php
/**
* @copyright David Fuhr
* @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
*/
declare(strict_types = 1);
namespace AppBundle\Validator\Constraints;
Verifying that "davidfuhr.id" is my Blockstack ID. https://onename.com/davidfuhr
Docker for Mac Beta 1.11.0-beta8 (build: 6072)
Transactions: 290 hits
Availability: 100.00 %
Elapsed time: 156.66 secs
Data transferred: 1.71 MB
Response time: 0.53 secs
Transaction rate: 1.85 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 0.98
@davidfuhr
davidfuhr / jdk-install.sh
Created December 8, 2015 11:34
Extracts and installs jdk package
#!/bin/bash
set -eou pipefail
if [ ! -f "$1" ]; then
echo $1 is not readable.
exit 1
fi
TEMPDIR=`mktemp -d`
<?php
namespace Pokus;
class Exception extends \Exception
{
}
function tttt($string)
{
try {
@davidfuhr
davidfuhr / gist:03a608d73bd7e2e28e39
Created November 29, 2014 11:56
phpunit.xml for symfony 2.7
<!-- Disable E_USER_DEPRECATED until 3.0 -->
<ini name="error_reporting" value="-16385"/>
@davidfuhr
davidfuhr / hhvminfo.php
Last active August 29, 2015 14:08 — forked from ck-on/hhvminfo.php
<?php
/*
HHVMinfo - phpinfo page for HHVM HipHop Virtual Machine
Author: _ck_
License: WTFPL, free for any kind of use or modification, I am not responsible for anything, please share your improvements
Version: 0.0.6
* revision history
0.0.6 2014-08-02 display fix for empty vs zero
0.0.5 2014-07-31 try to determine config file from process command line (may not always work), style improvements
@davidfuhr
davidfuhr / gist:90147d9e2d9d296f1775
Created July 16, 2014 09:03
KendoUI DataSource timestamp handling
transport: {
parameterMap: function (options, operation) {
if (operation === "update" || operation === "create") {
$.each(options, function (key, value) {
if (value instanceof Date) {
options[key] = Math.round(value.getTime() / 1000);
}
});
}
return options;