Skip to content

Instantly share code, notes, and snippets.

@chuyskywalker
chuyskywalker / gist:6385886
Last active December 22, 2015 00:00
Silent Killer

Silent Killer Numbers

Weapon Base Damage Silencer Damage Silent Killer Aced (+30%) Shotgun Extra Damage (+20%) Pistol Extra Damage (+25%)
Rifles
308 8 6 7.8
AK 7.62 4 3 3.9
AMR-16 3 2 2.6
CAR4 2.25 1.5 1.95
CAR4 (Stealth) 2.23
@chuyskywalker
chuyskywalker / enum.php
Created September 24, 2013 06:21
ENUM Experiment
<?php
namespace Enum {
abstract class Enum {
public function __toString() {
return get_called_class();
}
public static function types() {
$thisclass = get_called_class();
if (get_parent_class($thisclass) !== __CLASS__) {
Directory Structure:
- /gits/<repo>
- /www/<site base>/
- /www/<site base>/pages (docroot)
- /www/<site base>/conf.d/ (config files)
@chuyskywalker
chuyskywalker / configuration.txt
Last active January 2, 2016 06:48
Salt init, empty top.sls @ 1 minutes
Virtualbox
613mb ram
CentOS6.4
- based on this box: https://github.com/2creatives/vagrant-centos/releases/download/v6.5.2/centos65-x86_64-20131219.box
- from this fellow: https://github.com/2creatives/vagrant-centos/
Just a basic, masterless provision that takes 1 minutes to run.
Minion file looks like:
goofy:
- cmd.run:
- name: echo hello
@chuyskywalker
chuyskywalker / basic
Created April 21, 2014 03:49
quick docker contained app
# echo '{"test":123, "peso": [1,2,3]}' | docker run -i --rm --networking=false app /bin/bash -c 'cat - | php app.php'
object(stdClass)#1 (2) {
["test"]=>
int(123)
["peso"]=>
array(3) {
[0]=>
int(1)
[1]=>
int(2)
@chuyskywalker
chuyskywalker / client.php
Created August 13, 2014 05:46
Parallel Tasks Spawn Other Tasks As Available
<?php
require './defs.php';
$gearmanClient = new GearmanClient();
$gearmanClient->addServer();
$modelsToRun = [
ModelA::CLASS,
ModelB::CLASS,
@chuyskywalker
chuyskywalker / dance-party.php
Created August 14, 2014 04:48
Phillips Hue: Dance Party
<?php
/*
* Make your Hue lights dance -- a very rudimentary Hue control script
*/
$ip = 'your-ip-here';
$user = 'your-username-here';
$lights = array_flip(array(1,2)); // 3,4,5, etc
@chuyskywalker
chuyskywalker / memsql-sad.php
Last active February 5, 2016 07:07
memsql doesn't like medium ints on prepared statements
<?php
echo '<pre>';
/*
Have a table like
CREATE TABLE `inty` (
`biu` bigint unsigned NOT NULL AUTO_INCREMENT,
`bis` bigint NOT NULL ,
import time
import logging
import pprint
import random
from threading import Thread, Event
class lastPerThread(logging.Handler):
"""
A log handler which keeps the last log message availble per thread
"""