Skip to content

Instantly share code, notes, and snippets.

View mschultheiss83's full-sized avatar

Martin Schultheiß mschultheiss83

View GitHub Profile
@textarcana
textarcana / array-permutation.js
Last active May 20, 2020 12:52
Array permutation
/*jslint sloppy:true, white:true, vars:true, plusplus:true */
var permutation = function (collection){
var current,
subarray,
result = [],
currentArray = [],
newResultArray = [];
if (collection.length){
@Vinai
Vinai / fix-url-keys.php
Last active September 2, 2022 16:24
This fixes the duplicate url_key issue in a Magento 1.8 / 1.13 installation.
<?php
/**
* Drop this into the shell directory in the Magento root and run with -h to see all options.
*/
require_once 'abstract.php';
/**
* Fix duplicate url keys for categories and products to work with the 1.8 alpha1 CE url key constraints.

How to add a sprite

  1. Put icons in /app/assets/images/umlaut_icons

  2. Add compass-rails as an assets dependency at the bottom of the Gemfile

     gem "compass-rails", group: :assets
    
  3. Require compass-rails in the Umlaut Engine at `lib/umlaut.rb'

     require 'bootstrap-sass'
    
@guipdutra
guipdutra / gist:5341767
Created April 9, 2013 00:09
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
@qpleple
qpleple / Algorithms implementation in Python.ipynb
Last active December 15, 2015 23:39
Algorithm implementation in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var empty_list = function(selector) {
return selector(undefined, undefined, true);
};
var prepend = function(el, list) {
return function(selector) {
return selector(el, list, false);
};
};
var head = function(list) {
@azend
azend / HeaterBox.py
Last active December 14, 2015 01:59
Simple python script to warm up a cold room
#!/usr/bin/env python
import argparse
import threading
class Worker(threading.Thread):
def run (self):
while True:
pass;
@n1k0
n1k0 / 404checker.js
Created January 11, 2013 10:55
A CasperJS script to check for 404 & 500 internal links on a given website
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/
@sang4lv
sang4lv / gist:4499788
Created January 10, 2013 05:58
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());
}
@haochi
haochi / messages.js
Created January 10, 2013 05:54
Simple reddit messages search. Idea from /r/SomebodyMakeThis, http://redd.it/169agn.
(function ($) {
search(prompt("Enter Search Term:"));
function search(term, after) {
$.getJSON("/message/messages.json", {after: after}, function (res) {
var messages = res.data.children
, stop = false;
for (var i = 0, l = messages.length; i < l; i++) {
var message = messages[i];
if (message_a_match(message, term)) {