Skip to content

Instantly share code, notes, and snippets.

View mattjanssen's full-sized avatar
caffeinated

Matt Janssen mattjanssen

caffeinated
View GitHub Profile
@mattjanssen
mattjanssen / predis-decrement-delete.php
Last active November 12, 2020 18:18
Use Predis EVAL with a Redis Lua script to decrement a key, delete the key if the new value is zero, and then return the new value atomically.
<?php
$lua = <<<LUA
local c = redis.call('DECR', KEYS[1])
if c == 0 then
redis.call('DEL', KEYS[1])
end
return c
LUA;
I just received this from someone on https://www.immobilienscout24.de/ wanting to help me "find an apartment"...
"Hallo Ich habe Ihre Anzeige auf Immoscout.de gesehen Bitte kontaktieren Sie mich, ich habe etwas, das Sie interessieren könnte. Vielen Dank."
Hello,
How are you? I apologize for contacting you suddenly through this medium, I want to thank you so much for your answer on your Ad and I wish to let you know that I will be relocating to Germany and I am hoping as well that we can work together on a better and higher platform considering my relocation to your country, I sincerely want to trust you. I am a war veteran with the NATO troop in Afghanistan, on war against terrorism. I served in the 1st Armored Division in Baghdad Iraq and now serving in Afghanistan.
I will also need a property for my private purposes as i will be relocating to your country for my retirements, this is why i contacted you so that we can put head together towards my plan to invest in your country. As a result of this, it wi
<?xml version="1.0" encoding="utf-8"?>
<GeocodeFeed xmlns="http://schemas.microsoft.com/search/local/2010/5/geocode" Version="2.0">
<GeocodeEntity Id="001" xmlns="http://schemas.microsoft.com/search/local/2010/5/geocode">
<GeocodeRequest Culture="en-US" IncludeNeighborhood="1">
<Address AddressLine="1 Microsoft Way" AdminDistrict="WA" Locality="Redmond" PostalCode="98052" />
</GeocodeRequest>
</GeocodeEntity>
<GeocodeEntity Id="002" xmlns="http://schemas.microsoft.com/search/local/2010/5/geocode">
<GeocodeRequest IncludeNeighborhood="1" MaxResults="2" Query="Kings Road">
<ConfidenceFilter MinimumConfidence="Medium"/>
Bing Spatial Data Services, 2.0
Id| GeocodeRequest/Culture| GeocodeRequest/Query| GeocodeRequest/Address/AddressLine| GeocodeRequest/Address/AdminDistrict| GeocodeRequest/Address/CountryRegion| GeocodeRequest/Address/AdminDistrict2| GeocodeRequest/Address/FormattedAddress| GeocodeRequest/Address/Locality| GeocodeRequest/Address/PostalCode| GeocodeRequest/Address/PostalTown| GeocodeRequest/ConfidenceFilter/MinimumConfidence|ReverseGeocodeRequest/IncludeEntityTypes| ReverseGeocodeRequest/Location/Latitude| ReverseGeocodeRequest/Location/Longitude| GeocodeResponse/Address/AddressLine| GeocodeResponse/Address/AdminDistrict| GeocodeResponse/Address/CountryRegion| GeocodeResponse/Address/AdminDistrict2| GeocodeResponse/Address/FormattedAddress| GeocodeResponse/Address/Locality| GeocodeResponse/Address/PostalCode| GeocodeResponse/Address/PostalTown| GeocodeResponse/Address/Neighborhood| GeocodeResponse/Address/Landmark| GeocodeResponse/Confidence| GeocodeResponse/Name| GeocodeResponse/EntityType| GeocodeResponse/Mat
---
vagrantfile-local:
vm:
box: puphpet/centos65-x64
box_url: 'http://local.system/centos-6.5-x86_64-1400511516.box'
hostname: 'acme.dev'
memory: '2048'
chosen_provider: virtualbox
network:
private_network: 10.180.69.10
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/firewall/lib/facter/ip6tables_version.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/firewall/lib/facter/iptables_persistent_version.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/firewall/lib/facter/iptables_version.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/git/lib/facter/git_exec_path.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/git/lib/facter/git_version.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/php/lib/facter/php_fact_extension_dir.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/php/lib/facter/php_fact_version.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/puppi/lib/facter/last_run.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/puppi/lib/facter/puppi_projects.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/puppi/lib/facter/windows_common_appdata.rb
@mattjanssen
mattjanssen / OrmYamlFixture.php
Created December 18, 2013 06:48
Updated khepin/yaml-fixtures-bundle to query for existing entities before persisting a new one.
<?php
namespace Khepin\YamlFixturesBundle\Fixture;
use Doctrine\Common\Util\Inflector;
use Doctrine\ORM\Mapping\ClassMetadata;
class OrmYamlFixture extends AbstractFixture
{
/**