Skip to content

Instantly share code, notes, and snippets.

View bayi's full-sized avatar

Batári Balázs László bayi

  • Hungary
  • 11:30 (UTC +01:00)
View GitHub Profile
traceroute to 216.81.59.173 (216.81.59.173), 100 hops max, 60 byte packets
1 router1-dal.linode.com (67.18.7.161) 0.698 ms 0.685 ms 0.756 ms
2 xe-2-0-0.car03.dllstx2.networklayer.com (67.18.7.89) 0.341 ms 0.326 ms 0.311 ms
3 po101.dsr02.dllstx2.networklayer.com (70.87.254.77) 0.584 ms 0.663 ms 0.665 ms
4 po22.dsr02.dllstx3.networklayer.com (70.87.255.69) 0.809 ms 0.861 ms 0.947 ms
5 ae17.bbr02.eq01.dal03.networklayer.com (173.192.18.230) 0.501 ms 0.478 ms 0.451 ms
6 ae7.bbr01.eq01.dal03.networklayer.com (173.192.18.208) 0.475 ms 0.653 ms 10gigabitethernet3-1.core1.dal1.he.net (206.223.118.37) 6.020 ms
7 10gigabitethernet3-1.core1.dal1.he.net (206.223.118.37) 1.455 ms 1.581 ms 10gigabitethernet5-4.core1.atl1.he.net (184.105.213.114) 21.941 ms
8 10gigabitethernet5-4.core1.atl1.he.net (184.105.213.114) 22.013 ms 216.66.0.26 (216.66.0.26) 20.970 ms 21.238 ms
9 10.26.26.102 (10.26.26.102) 58.340 ms 56.423 ms 216.66.0.26 (216.66.0.26) 20.832 ms
@bayi
bayi / gist:4747873
Created February 10, 2013 01:16
Singleton Trait for PHP
<?php
trait SingletonClass {
protected static $instance;
final public static function getInstance() {
return isset(static::$instance)
? static::$instance
: static::$instance = new static;
}
<?php
try {
$pdo = new PDO(
'mysql:host=localhost;dbname=test_database',
'username',
'password',
array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'