⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
(* | |
-------- WHAT THIS DOES -------- | |
Enables you to externally open a specific file in eclipse, and go to some line | |
that is, makes a link with href of | |
openineclipse://open?url=file:///absolute/path/tofile.ext&line=5 | |
open absolute/path/tofile.ext in eclipse | |
and go to line 5 |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#!/usr/bin/php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP error (lint), and make sure the code | |
* is PSR compliant. | |
* | |
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
* |
# -*- Conf -*- | |
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
showbranch = auto | |
ui = true | |
# color.branch | |
# A boolean to enable/disable color in the output of git-branch(1). May be set to always, false (or |
# Basic benchmarks | |
# SET key val # 87489.06 | |
# SETRANGE key2 6 "Redis" # 75757.58 req/s | |
# INCR key 245 # 70224.72 req/s | |
# INCRBY key 245 22 # 67114.09 req/s | |
# EVAL SET key val # 46296.29 req/s | |
# SETIFHIGHER (set or update key if new value is higher than current) # 41666.67 req/s | |
# if not exists return OK , if updated return the increment , if not updated return 0 | |
SCRIPT LOAD "local c = tonumber(redis.call('get', KEYS[1])); if c then if tonumber(ARGV[1]) > c then redis.call('set', KEYS[1], ARGV[1]) return tonumber(ARGV[1]) - c else return 0 end else return redis.call('set', KEYS[1], ARGV[1]) end" |
This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)
The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array
it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array
part of it away. So how does that work?
The key here is that objects usually have a predefined set of keys, whereas arrays don't:
Warning: Like the shitty OSS person I am, I forgot to update this. This particular iteration is exploitable in a really basic way that I missed. I will update this with the updated version hopefully soon
While authing against our Google Apps domain has worked pretty well up until now, we really needed a way to auth against out Github organization. Not everyone who is accessing some of our protected development content has an email account in our Google Apps domain. They do, however, have access to our github org.
Sadly it seems that apache and nginx modules for doing oauth are lacking.
I was hoping to avoid the whole lua approach (and mod_authnz_external
was a no go from the start). However I realized that Brian Akins (@bakins) had done some fancy omnibus work that got me 90% of the way there.
From there it was a matter of patching up the omnibus repo to bring it to current versions as well as adding in a few additional components.
<?php | |
namespace Acme\DemiBundle\Controller; | |
use Doctrine\DBAL\Migrations\Migration; | |
use Doctrine\DBAL\Migrations\Configuration\Configuration; | |
class MigrateController extends BaseController | |
{ | |
public function indexAction() |
input { | |
file { | |
type => "php-error" | |
path => "/var/www/error_log" | |
sincedb_path => "/opt/logstash/sincedb-access" | |
} | |
} |