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 / 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 / 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 / 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 / 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>";
@keriati
keriati / example.js
Created June 22, 2012 20:27
Revealing module pattern
(function() {
var NS = {};
NS.Parent = function() {
var privateFoo = "Private foobar in Parent";
function _foo(data) {
console.log("foo: " + data);
console.log(privateFoo);
@keriati
keriati / gitexp.sh
Created August 7, 2012 10:02
Git export changed files
tar czf new-files.tar.gz `git diff --name-only [COMMIT]`
@keriati
keriati / rsync.sh
Created August 7, 2012 16:16
rsync folders with delete
rsync -rtv --exclude-from="/full/path/to/rsync-exclude.txt" --delete /source /destination > rsync-log.txt
@keriati
keriati / error.php
Created August 9, 2012 08:56
PHP errors on!
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
@keriati
keriati / patter.html
Created August 10, 2012 20:07
Input validation with patterns
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.center {
text-align: center;
}
#myInput {
@keriati
keriati / scrolling.html
Created August 20, 2012 19:59
Basic scrolling menu example
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.hide {
display: none;
}
</style>