Skip to content

Instantly share code, notes, and snippets.

View keriati's full-sized avatar
👨‍💻
Working...

Attila Kerekes keriati

👨‍💻
Working...
View GitHub Profile
@keriati
keriati / 404
Created March 7, 2012 07:55
HTML: Basic Template
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="Scroll demo page">
<meta name="viewport" content="width=device-width">
@keriati
keriati / normalize.min.css
Created March 27, 2012 13:36
Normalize minimized
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block}
audio,canvas,video{display:inline-block;*display:inline;*zoom:1}
audio:not([controls]){display:none;height:0}
[hidden]{display:none}
html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}
html,button,input,select,textarea{font-family:sans-serif}
body{margin:0;padding:0}
a:focus{outline:thin dotted}
a:hover,a:active{outline:0}
h1{font-size:2em;margin:0.67em 0}
@keriati
keriati / helper-classes.css
Created March 27, 2012 19:45
h5bp helper classes only
.ir { border:0; font: 0/0 a; text-shadow: none; color: transparent; background-color: transparent; }
.hidden { display: none !important; visibility: hidden; }
.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
.invisible { visibility: hidden; }
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { *zoom: 1; }
.pull-left { float:left; }
@keriati
keriati / compressor.sh
Created March 29, 2012 19:28
Compress all javascript files in the directory
#!/bin/bash
for filein in `find . -name "*.js" | grep -v \.min\.js`
do
fileout=${filein/\.js/\.min\.js}
echo "Compressing $filein => $fileout"
java -jar ~/bin/yuicompressor-2.4.7.jar $filein > $fileout
done
echo "Finished."
@keriati
keriati / detectMobile.js
Created April 11, 2012 07:45
Mobile Browser Detection Javascript
// Bad practice!
function detectMobile() {
return (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
}
@keriati
keriati / mq-size.html
Created April 30, 2012 13:45
I have no idea...
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
@media all and (max-width: 640px) {
body:after {
content: 'small';
@keriati
keriati / namespace.js
Created May 9, 2012 21:50
Just some namespace
(function() {
function myNS() {
var myNS = this;
function _copy(target, source) {
var key;
for (key in source) {
if (typeof target[key] === 'undefined') {
@keriati
keriati / post-receive
Created June 5, 2012 15:09
Post receive hook: git "deploy" after push
#!/bin/sh
cd ..
GIT_DIR='.git'
umask 002 && git reset --hard
@keriati
keriati / authorized_keys
Created June 5, 2012 15:26
Force git shell with public key auth
command="perl -e 'exec qw(git-shell -c), $ENV{SSH_ORIGINAL_COMMAND}'" ssh-rsa ....
@keriati
keriati / l.php
Created June 6, 2012 08:45
For the silent game
<?php ini_set('display_errors', 1);error_reporting(E_ALL);
$d=isset($_GET['d'])?urldecode($_GET['d']):dirname(__FILE__);
if(is_file($d)&&(header('Content-disposition: attachment; filename='.end(explode("/",$d)))||readfile($d)))exit();
foreach(scandir($d)as$f)echo'<li><a href="?d='.urlencode(realpath($d)."/$f")."\">$f</a></li>";