Skip to content

Instantly share code, notes, and snippets.

View tamagokun's full-sized avatar

Mike Kruk tamagokun

View GitHub Profile
@tamagokun
tamagokun / reset.css
Created July 27, 2011 20:01
CSS Reset Rules
/* ----- RESET (based on the work of Richard Clark - http://richclarkdesign.com) ----- */
html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,dialog,figure,footer,header,hgroup,menu,nav,section,menu,time,mark,audio,video,summary,figcaption{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;}
body{line-height:1;}
article,aside,dialog,figure,footer,header,hgroup,nav,section{display:block;}
nav ul{list-style:none;}
blockquote,q{quotes:none;}
blockquote:before,blockquote:after,
q:before,q:after{content:'';content:none;}
a{margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline;background:transparent;}
ins{background-color:#ff9;color:#000;text-decoration:none;}
@tamagokun
tamagokun / Console.as
Created July 27, 2011 20:02
AS3 Trace Console for Google Chrome/Firebug
package
{
import flash.display.Sprite;
import flash.events.ErrorEvent;
import flash.events.UncaughtErrorEvent;
import flash.external.ExternalInterface;
public class Console extends Sprite
{
public function Console():void
@tamagokun
tamagokun / gist:1165851
Created August 23, 2011 16:57
group permissions for a system managed git repo
chgrp -R webeditor gitrepo.git
chmod -R g+swX gitrepo.git
@tamagokun
tamagokun / 404-handler.php
Created August 29, 2011 20:36
Wordpress permalinks under IIS 6.0
<?php
// This is the default file for the site. Usually index.php
$default = 'index.php';
// The name of this file.
// Set this value for the URL in Custom Error Properties of your website in IIS.
// Goto: IIS Manager > Websites > [Site Name] > Properties > Custom Errors >
// 404 & 404;2 & 404;3 > URL (Requires a '/' prefix in IIS).
$thisfile = '404-handler.php';
@tamagokun
tamagokun / nginx
Created November 3, 2011 17:52
nginx init script for starting, stopping, etc.
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
@tamagokun
tamagokun / nginx-site
Created November 3, 2011 19:02
Script to easily enable and disable nginx sites
#!/bin/sh
domain=$2
available_dir="/usr/local/nginx/sites-available"
enable_dir="/usr/local/nginx/sites-enabled"
enable() {
if [ -e "$available_dir/$domain" ]
then
sudo ln -s $available_dir/$domain $enable_dir/$domain
@tamagokun
tamagokun / php_proxy.conf
Created November 4, 2011 15:27
Apache PHP proxy for Nginx sites (mainly Wordpress)
location / {
index index.php;
try_files $uri $uri/ /index.php$args;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
location ~ \.php {
proxy_set_header X-Real-IP $remote_addr;
@tamagokun
tamagokun / full-background.css
Created November 20, 2011 22:31
Full backgrounds in CSS
html
{
background: #fff url('../Main_bg.jpg') no-repeat top center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100%;
width: 100%;
text-rendering: optimizeLegibility;
@tamagokun
tamagokun / HTML.php
Created November 23, 2011 18:39
Quick php util for creating HTML
<?php
class HTML
{
public static function __callStatic($tag,$args)
{
$options = array_shift($args);
$content = ($args)? array_shift($args) : "";
return self::element($tag,$options,$content);
}
@tamagokun
tamagokun / test.php
Created December 15, 2011 05:08
return function as reference problem in PHP
class Foo
{
static $foobar = 5;
function &bar()
{
return self::$foobar;
}
}