Skip to content

Instantly share code, notes, and snippets.

@witwall
witwall / php.ini
Last active November 19, 2015 14:45
;for windows
extension_dir = "ext"
extension=php_pdo_sqlite.dll
extension=php_sqlite3.dll
;for linux
extension=php_pdo_sqlite.so
extension=php_sqlite3.so
<?PHP
require __DIR__ . '/vendor/autoload.php';

$log = new Monolog\Logger('name');
$log->pushHandler(new Monolog\Handler\StreamHandler('app.log', Monolog\Logger::WARNING));
$log->addWarning('Foo');
?>
@witwall
witwall / 1 - setting up RVM.sh
Created April 6, 2013 08:55
RVM and Bundler on Dreamhost, I can access https://gist.github.com/muffinista/3276350, so I copy it from the google cache
#
# Step One - Installing RVM
#
curl -L https://get.rvm.io | bash -s stable --ruby
# Then, install ruby 1.8.7 -- you need to basically match the same version of Ruby as Dreamhost
rvm install ruby-1.8.7-p334
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
Options +FollowSymLinks +ExecCGI
RewriteEngine On
import java.awt.Graphics;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;
import java.awt.Image;
import java.awt.Transparency;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.PixelGrabber;
@witwall
witwall / hosts
Created November 4, 2013 14:25
hosts
#UPDATE:2013-07-07 21:01
127.0.0.1 localhost
#SmartHosts START
#Google Services START
203.208.46.200 0.docs.google.com
203.208.46.200 0.drive.google.com
203.208.46.200 1.docs.google.com
@witwall
witwall / php.ini
Created February 16, 2016 14:13
php.ini(PHP 5.6.15)
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@witwall
witwall / count.vba
Last active February 26, 2016 03:56
=(LEN(C3)-LEN(SUBSTITUTE(C3,B3,"")))/LEN(B3)
### Sample knitr Doc
###Copy and paste all the code to http://shiny.alitrack.com/ace/03-knitr/
This is some markdown text. It may also have embedded R code
which will be executed.
```{r results="asis" ,echo=FALSE}
dat <- data.frame(
t = rep(0:23, each = 4),
var = rep(LETTERS[1:4], 4),
val = round(runif(4*24,0,50))
# -*- coding: utf-8 -*-
#encoding=utf-8
import urllib2
import sys, json
from StringIO import StringIO
import gzip
import MySQLdb
import datetime