This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Service < Thor | |
desc "apache", "Apache" | |
def apache(action) | |
service action do |s| | |
s.down { %x[sudo apachectl stop] } | |
s.up { %x[sudo apachectl start] } | |
end | |
end | |
desc "memcached", "Memcached" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DoctrineCacheAdapter extends \Doctrine\Common\Cache\CacheProvider { | |
private $cache_driver; | |
public function __construct($cache_driver) { | |
$this->cache_driver = $cache_driver; | |
} | |
public function getCacheDriver() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
require 'formula' | |
class Apache24 < Formula | |
homepage 'https://httpd.apache.org/' | |
url 'https://www.apache.org/dist/httpd/httpd-2.4.3.tar.gz' | |
sha1 '845ca56816b0352c7759b6b8f47bd012c0864efd' | |
version '2.4.3' | |
skip_clean ['bin', 'sbin'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
sudo vim /Library/LaunchDaemons/local.httpdfwd.plist | |
sudo launchctl load -Fw /Library/LaunchDaemons/local.httpdfwd.plist | |
https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew | |
--> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"\> | |
<plist version="1.0"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# install https://github.com/tagomoris/fluent-plugin-forest | |
# | |
# test | |
<source> | |
type tail | |
format /^(?<log>.*)$/ | |
tag test | |
path /tmp/test.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class LibratoClient | |
{ | |
protected $user; | |
protected $token; | |
protected $metrics; | |
public function __construct($user, $token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="container"> | |
<div id="element"> | |
centered content | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = $argv[1]; | |
$table = $argv[2]; | |
$ls = file($file); | |
$out = ""; | |
foreach ($ls as $l) { | |
$d = str_getcsv(trim($l)); |