Skip to content

Instantly share code, notes, and snippets.

find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
echo .DS_Store >> .gitignore
# add this ppa
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
# install launchpad-getkeys
sudo apt-get install launchpad-getkeys
# run it
sudo launchpad-getkeys
@koloda
koloda / gist:fd3c78c01d9230caa6e1e15c8559f396
Created October 10, 2017 16:40 — forked from oscar-broman/gist:3653399
UTF8 encode array/object structure in PHP
<?php
function utf8_encode_deep(&$input) {
if (is_string($input)) {
$input = utf8_encode($input);
} else if (is_array($input)) {
foreach ($input as &$value) {
utf8_encode_deep($value);
}
unset($value);
@koloda
koloda / gist:9ba26631afc984dc3da8
Created May 12, 2015 11:36
set keyboard switching to Alt+Shift (in elementary OS)
gsettings set org.pantheon.desktop.gala.keybindings switch-input-source "['<Alt>Shift_L', '<Alt>Shift_R', '<Shift>Alt_L', '<Shift>Alt_R']"
@koloda
koloda / url_get_params_as_array.js
Last active August 29, 2015 14:16
(JS) Считывает GET переменные из URL страницы и возвращает их как ассоциативный массив.
function getUrlVars()
{
var vars = {}, hash;
var hashes = window.location.toString().slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars[hash[0]] = hash[1];
}
@koloda
koloda / jsDateToFormatFunction
Created July 12, 2014 00:21
js - date to format function
if(!Date.prototype.toLocaleFormat){
Date.prototype.toLocaleFormat = function(format) {
var f = {
Y : this.getFullYear(),
y : this.getFullYear()-(this.getFullYear()>=2e3?2e3:1900),
m : this.getMonth() + 1,
d : this.getDate(),
H : this.getHours(),
M : this.getMinutes(),
S : this.getSeconds()
@koloda
koloda / changeJavaVersion
Created July 10, 2014 13:20
change Java version
sudo update-alternatives --config javac
sudo update-alternatives --config java
@koloda
koloda / elementarySoftwareInstaller.sh
Last active January 21, 2016 12:21
Install all software after installing clean ElementaryOs
#! /bin/bash
wait
apt-get update
wait
apt-get upgrade
wait
apt-get install php5 php5-xdebug php5-xmlrpc php5-odbc php5-mysql php5-memcache php5-memcached php5-mcrypt php5-intl php5-imap php5-imagick php5-gd php5-curl php5-cli php-pear php-codesniffer
wait
sudo apt-add-repository ppa:glasen/intel-driver
sudo apt-get update
sudo apt-get install xserver-xorg-video-intel
#If you use Ubuntu 12.04, then you can enable the 'SNA' feature (disabled by default) of Intel Sandy Bridge architecture which improves #both 2D and 3D performance. For that, enter the below command in your Terminal window to open the text editor with administrative #privileges. (/etc/X11/xorg.conf)
Section "Device"
Identifier "Card0″
Driver "intel"
Option "AccelMethod" "sna"
apt-get install -y ppa-purge
add-apt-repository -y ppa:ondrej/php5-oldstable
apt-get update
ppa-purge ppa:ondrej/php5
apt-get update && apt-get upgrade -y && apt-get autoremove -y && apt-get autoclean -y