Skip to content

Instantly share code, notes, and snippets.

View mschultheiss83's full-sized avatar

Martin Schultheiß mschultheiss83

View GitHub Profile
@mschultheiss83
mschultheiss83 / awesome-php.md
Created November 9, 2012 11:54 — forked from melihbuyuk/awesome-php.md
Awesome PHP Libraries
@mschultheiss83
mschultheiss83 / autobackupmongo.rb
Created November 10, 2012 02:14 — forked from ashayh/autobackupmongo.rb
auto backup mongo (ruby version and very concise)
#!/usr/local/ruby/bin/ruby -w
Dbpath = "/data/db" # database path
Backpath = "/data/dbbackup" # backup directory
Host = "" # mongo host to connect,empty is for local
Database = "" # database to use. empty is for all
Collection = "" # collection to use
User = ""
Passwd = ""
Now = Time.now
DATE = Now.strftime("%Y-%m-%d")
UPLOADCORE
http://www.uploadcore.com/yzjsyg8ercgt
http://www.uploadcore.com/wvs19j2cvi1p
http://www.uploadcore.com/oakdpstv2zze
http://www.uploadcore.com/ifbeetlqjh4w
http://www.uploadcore.com/h3qux54lurrv
http://www.uploadcore.com/awii8qjr5gkm
http://www.uploadcore.com/3rx7ypi8fbna
http://www.uploadcore.com/2udunk9dk3if
@mschultheiss83
mschultheiss83 / gist:4499800
Created January 10, 2013 06:03 — forked from sang4lv/gist:4499788
MySQLi example
<?php
function processURL($originalURL, $array) {
$base = "http://example.com";
$avail = "";
$link = new mysqli($host, $user, $pass, $daba);
if(mysqli_connect_errno()) {
die("Connection failed" . mysqli_connect_error());
}
\documentclass[10pt,a4paper]{article}
\usepackage{multicol}
\usepackage{amsmath, amssymb, amsthm}
\usepackage[margin=.3in]{geometry}
\usepackage[normalem]{ulem}
\begin{document}
--- a/app/code/core/Mage/Core/Model/App.php
+++ b/app/code/core/Mage/Core/Model/App.php
@@ -511,11 +511,7 @@ class Mage_Core_Model_App
if ($this->_currentStore == $store) {
$store = $this->getStore($store);
- if ($store->getWebsite()->getDefaultStore()->getId() == $store->getId()) {
- $this->getCookie()->delete(Mage_Core_Model_Store::COOKIE_NAME);
- } else {
- $this->getCookie()->set(Mage_Core_Model_Store::COOKIE_NAME, $this->_currentStore, true);
#!/bin/sh
branch=$(git branch 2>/dev/null | grep ^\*)
[ x$1 != x ] && tracking=$1 || tracking=${branch/* /}
git config branch.$tracking.remote origin
git config branch.$tracking.merge refs/heads/$tracking
echo "tracking origin/$tracking"
@mschultheiss83
mschultheiss83 / gist:5341885
Created April 9, 2013 00:29 — forked from guipdutra/gist:5341767
git log pretty format
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@mschultheiss83
mschultheiss83 / gist:5341886
Created April 9, 2013 00:29 — forked from guipdutra/gist:5341767
git log pretty format
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@mschultheiss83
mschultheiss83 / gist:5341888
Created April 9, 2013 00:30 — forked from guipdutra/gist:5341767
git log pretty format
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit