Skip to content

Instantly share code, notes, and snippets.

View drola's full-sized avatar

Matjaž Drolc drola

View GitHub Profile
@drola
drola / MenuBuilder.php
Last active December 14, 2015 22:48 — forked from nielsmouthaan/MenuBuilder.php
KnpMenuBundle - integration with Twitter Bootstrap
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
@drola
drola / kubuntu_dev_bootstrap.sh
Last active December 15, 2015 08:39
(K)Ubuntu setup The script installs the LAMP stack, Composer, Oracle Java 7 JDK, Qt development tools, Zsh (and sets it as the default shell), Google Chrome, Opera, Clementine, XChat, Filezilla, Sublime Text 2 and Virtualbox.
#!/bin/bash
#Repositiories
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo add-apt-repository ppa:webupd8team/java
sudo add-apt-repository ppa:chris-lea/node.js
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
wget -O - http://deb.opera.com/archive.key | sudo apt-key add -
sudo sh -c 'echo "deb http://deb.opera.com/opera/ stable non-free" >> /etc/apt/sources.list.d/opera.list'
@drola
drola / amazon_s3_backup.sh
Created March 24, 2013 22:16
Simple script to backup your files and MySql database to Amazon S3
#!/bin/bash
############# More information #############
# http://drola.si/backing-up-to-amazon-s3/ #
############################################
EC2_ACCESS_KEY=YOUR_ACCESS_KEY
EC2_SECRET_KEY=YOUR_SECRET_ACCESS_KEY
BUCKET_NAME="NAME_OF_THE_BUCKET"
MYSQL_PASSWORD="MYSQL_ROOT_PASSWORD"
@drola
drola / bootstrap.sh
Last active December 15, 2015 13:49
Ubuntu GNOME dev bootstrap
#!/bin/bash
#Repositiories
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo add-apt-repository ppa:webupd8team/java
sudo add-apt-repository ppa:chris-lea/node.js
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
wget -O - http://deb.opera.com/archive.key | sudo apt-key add -
sudo sh -c 'echo "deb http://deb.opera.com/opera/ stable non-free" >> /etc/apt/sources.list.d/opera.list'
@drola
drola / install.sh
Created March 30, 2013 20:22
GNOME build deps
sudo apt-get install libnl-3-dev libnl-route-3-dev libnl-genl-3-dev
@drola
drola / .zshrc
Created August 25, 2013 21:44
.zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
#!/bin/bash
#Repositiories
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo add-apt-repository ppa:webupd8team/java
sudo add-apt-repository ppa:chris-lea/node.js
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
wget -O - http://deb.opera.com/archive.key | sudo apt-key add -
sudo sh -c 'echo "deb http://deb.opera.com/opera/ stable non-free" >> /etc/apt/sources.list.d/opera.list'
@drola
drola / ajax-form.js
Last active December 23, 2015 11:28 — forked from havvg/ajax-form.js
jQuery(function($) {
$(document).on('submit', 'form[data-async]', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
sudo add-apt-repository ppa:reviczky/context-daily
sudo apt-get update
sudo apt-get install context texworks kbibtex
#Copy this to ~/.bashrc or ~/.profile
export OSFONTDIR=~/.fonts:/usr/share/fonts:/usr/share/texmf/fonts/opentype/:/opt/libreoffice/basis3.3/share/fonts/
mtxrun --script fonts --reload
mtxrun --script fonts --list --all --pattern=*
context --reload
@drola
drola / bootstrap_trusty.sh
Last active August 29, 2015 13:58
Ubuntu Trusty Tahr dev bootstrap
#!/bin/bash
#Repositiories
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo add-apt-repository ppa:webupd8team/java
sudo add-apt-repository ppa:chris-lea/node.js
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
wget -O - http://deb.opera.com/archive.key | sudo apt-key add -
sudo sh -c 'echo "deb http://deb.opera.com/opera/ stable non-free" >> /etc/apt/sources.list.d/opera.list'