Skip to content

Instantly share code, notes, and snippets.

@asgrim
asgrim / gist:3445d0977ca0d7839372
Created June 9, 2014 08:58
So apparently, this is what happens when you update Composer at the same moment as you're running a composer update...
update-deps:
[echo] Composer update
[exec] Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
[exec] Loading composer repositories with package information
[exec] Updating dependencies (including require-dev)
[exec] e)
[exec] {
[exec] $this->addReason($rule->getId(), array(
[exec] 'rule' => $rule,
[exec] 'job' => $rule->getJob(),
@media (min-width: 1100px) {
.site-header {
min-width: 230px;
min-width: 23rem;
width: 30%;
padding-left: 5%;
padding-top: 3rem;
position: fixed;
float: left;
max-width: 520px; /* <--- this should do the job :) */
<?php
$flockHandle = fopen('/tmp/blah.lock', 'w');
if (!flock($flockHandle, LOCK_EX | LOCK_NB))
{
echo "Cannot get lock.";
die();
}
// do something
@asgrim
asgrim / .etc.opt.chrome.policies.managed.show_modal_dialog_policy.json
Created September 8, 2014 10:19
Temporary fix for Chrome removing showModalDialog (breaking OWA)
{
"EnableDeprecatedWebPlatformFeatures": ["ShowModalDialog_EffectiveUntil20150430"]
}
@asgrim
asgrim / opencfp.sql
Created January 13, 2015 08:47
Export talks from OpenCFP
SELECT
/* user */ users.id AS user_id, first_name, last_name, email, company, twitter, airport, url, transportation, hotel, info, bio,
/* talk */ talks.id AS talk_id, title, description, other, type, level, category, slides, desired, sponsor
FROM `talks`, `users`
WHERE talks.user_id = users.id
@asgrim
asgrim / .gitignore
Last active August 29, 2015 14:14
My stack interpreter from Cute Little Interpreters tutorial at phpbnl15
vendor
@asgrim
asgrim / blah.php
Last active August 29, 2015 14:14
function foo($value)
{
return ['hello', $value];
}
#include <iostream>
using namespace std;
int main()
{
int v;
int *ptr = &v;
*ptr = 15;
@asgrim
asgrim / vpn.sh
Created May 11, 2015 09:23
OpenVPN with nameserver - when you connect to a VPN that does not automatically set appropriate nameserver, this wraps it and makes it work.
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "You must be root..."
exit 1
fi
sed -i -e "s/search homerouter\.cpe/nameserver 192.168.2.2\nsearch homerouter.cpe/" /etc/resolv.conf
openvpn --config #path-to-ovpn-config#
sed -i '/nameserver 192.168.2.2/d' /etc/resolv.conf
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ZendTest\EventManager;