Skip to content

Instantly share code, notes, and snippets.

View mborodov's full-sized avatar
🏠
Working from home

Maksim Borodov mborodov

🏠
Working from home
View GitHub Profile
@mariux
mariux / ubuntu-install-hipchat2.sh
Last active June 3, 2018 17:09 — forked from stephanetimmermans/ubuntu-hipchat
Install atlassian hipchat client on Ubuntu 16.04
sudo su
echo "deb http://downloads.hipchat.com/linux/apt stable main" > /etc/apt/sources.list.d/atlassian-hipchat.list
wget -O - https://www.hipchat.com/keys/hipchat-linux.key | apt-key add -
apt-get update
apt-get install hipchat
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@hollodotme
hollodotme / Install-php7.md
Last active August 11, 2022 06:23
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@chrisjhoughton
chrisjhoughton / remove.liquid
Last active September 9, 2023 07:56
Remove a Shopify cart attribute
{% if cart.attributes.yourCartAttribute %}
<script>
$.ajax({
type: 'POST',
url: '/cart/update.js',
data: 'attributes[yourCartAttribute]=',
dataType: 'json'
});
</script>
{% endif %}
@baskaran-md
baskaran-md / nginx.conf
Created September 2, 2014 20:20
NginX allow POST on static pages.
# ...
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
@peterjaap
peterjaap / quickmodman
Created January 16, 2013 10:52
Quickly generate modman file for Magento extensions
for i in `find . -type f | grep -v \.git | grep -v "^.$" | grep -v "modman" | sed 's/\.\///'`; do echo ${i} ${i}; done > modman
@realmyst
realmyst / gist:3340984
Created August 13, 2012 13:53 — forked from kosmatov/image-preview-html5.js
File preview on HTML5/JS/jQuery
$('form').on('change', 'input[type="file"]', function(e) {
var files = e.target.files,
f = files[0],
reader = new FileReader(),
t = this
;
reader.onload = (function(file) {
@realmyst
realmyst / gist:1262561
Created October 4, 2011 19:34
Склонение числительных в javascript
function declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
use:
declOfNum(count, ['найдена', 'найдено', 'найдены']);