Skip to content

Instantly share code, notes, and snippets.

View r8's full-sized avatar
🔍
Open to work

Sergey Storchay r8

🔍
Open to work
View GitHub Profile
@colinmollenhour
colinmollenhour / tunnlr.sh
Created February 8, 2014 00:01
Easily configure and launch your Tunnlr.com SSH tunnel!
#!/bin/bash
#
# A simple function for starting an SSH tunnel (e.g. tunnlr.com)
#
# Add the function to your .bashrc file or use this script standalone
# Takes port to forward to as only parameter
function tunnlr(){
[ -z $1 ] && { echo "You must specify a port to forward to."; return 1; }
if [ -f ~/.tunnlr ]; then
#!/bin/sh
#
# Adam Sharp
# Aug 21, 2013
#
# Usage: Add it to your PATH and `git remove-submodule path/to/submodule`.
#
# Does the inverse of `git submodule add`:
# 1) `deinit` the submodule
# 2) Remove the submodule from the index and working directory
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@donarus
donarus / switchClass.js
Created June 6, 2013 22:20
Simple jQuery plugin for dynamic changing classes of html elements. The main goal of this simple plugin is to allow changing bootstrap spanX classes dynamically. For example on large display, you want to have two divs with classes 'span3' and 'span9'. On small displays you might want to have class 'span5' for first div and 'span6' for second. Th…
/*
* Author: Tadeas 'donarus' Palusga - www.palusga.cz - tadeas@palusga.cz
* Licence: Do whatever you want and let me know if it helps :)
*/
if (typeof Object.create !== 'function') {
// function Object.create could be undefined in older browsers
Object.create = function (obj) {
function F() {
};
@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.
@ma2thieu
ma2thieu / replace_php_short_tags.sh
Created February 23, 2013 18:50
replace php short tags (<?) with long one (<?php)
#!/bin/bash
# first short tags with something that is not a letter after
find . -iname "*.php" -print0 | xargs -0 -I{} sed -i -r 's/(<\?)([^a-zA-Z])/\1php\2/g' '{}'
# then short tags at end of line
find . -iname "*.php" -print0 | xargs -0 -I{} sed -i -r 's/<\?$/<\?php/g' '{}'
@ck-on
ck-on / ocp.php
Last active May 18, 2024 22:35
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@knoopx
knoopx / post-commit.rb
Created June 14, 2012 22:04
Gitshots Post-Commit Hook
#!/usr/bin/env ruby
# Requires imagesnap from https://github.com/alexwilliamsca/imagesnap (brew install imagesnap)
# To assemble the video use http://www.dayofthenewdan.com/projects/tlassemble
file="~/.gitshots/#{Time.now.to_i}.jpg"
puts "Taking capture into #{file}!"
system "imagesnap -q -w 3 #{file}"
exit 0