Skip to content

Instantly share code, notes, and snippets.

View AlexKru's full-sized avatar

Aleksey Krupin AlexKru

View GitHub Profile
@Stasevi4
Stasevi4 / jpegoptim
Last active July 8, 2016 12:45
Optimize images in folder ( Magento optimize image) jpegoptim and optipng
sudo apt-get install jpegoptim
sudo apt-get install optipng
find /path/to/magento/ -iname '*.jpg' -exec jpegoptim --strip-all -p {} \; -exec chmod 755 {} \; -exec chown www-data:www-data {} \;
find . -iname '*.png' -exec optipng -o7 -preserve {} \; -exec chown www-data:www-data {} \;
@jamarparris
jamarparris / Generate Mongo Object ID in PostGres
Last active March 20, 2024 00:04
Create ObjectIds in PostGres following the MongoDB semantics. Very similar to the Instagram approach linked below.http://docs.mongodb.org/manual/reference/object-id/http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram
The MIT License (MIT)
Copyright (c) 2013 Jamar Parris
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@skaag
skaag / redmine2.3inst.sh
Created May 9, 2013 14:43
Redmine 2.3 installation on Ubuntu 12.04 with RVM, Ruby 2.0, Passenger 4 and Nginx
# Install some system dependencies:
apt-get install build-essential openssl libcurl4-openssl-dev \
libreadline6 libreadline6-dev curl mysql-server libmysqlclient-dev git-core \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev \
libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion \
pkg-config imagemagick joe libmagickwand-dev libmagickwand4
# Install Ruby via RVM (easiest!):
cd /root/
@mystix
mystix / setup-php-dev.sh
Last active April 27, 2023 15:46
(OSX 10.7.x/10.8.x + Homebrew + nginx + mysql + php 5.4 + php-fpm + apc + xdebug) development environment
#!/bin/bash
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
# install homebrew-dupes (required to install zlib, php54's dependency)
brew tap homebrew/dupes
# install nginx + mysql + php 5.4 + php-fpm + apc + xdebug
brew install nginx mysql
@bartimaeus
bartimaeus / install-ruby.sh
Created May 31, 2012 19:55 — forked from ryanb/chef_solo_bootstrap.sh
Install Ruby 1.9.3-p286 on Ubuntu 12.04 LTS
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libxml2-dev libxslt-dev libreadline6-dev libyaml-dev
# apt-get -y install libmysqlclient-dev # uncomment for mysql support
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p286.tar.gz
tar -xvzf ruby-1.9.3-p286.tar.gz
cd ruby-1.9.3-p286/
./configure --prefix=/usr/local
make
@tlync
tlync / jquery-doubletap.js
Created June 9, 2011 03:45
jquery double tap plugin - Bind an event handler to the "double tap" JavaScript event.
(function($){
var hasTouch = /android|iphone|ipad/i.test(navigator.userAgent.toLowerCase()),
eventName = hasTouch ? 'touchend' : 'click';
/**
* Bind an event handler to the "double tap" JavaScript event.
* @param {function} doubleTapHandler
* @param {number} [delay=300]
*/