Skip to content

Instantly share code, notes, and snippets.

@rbalazs
rbalazs / gist:7217949
Created October 29, 2013 16:25
Pick random lement from array.
randomPointOnCirlce = points[Math.floor(Math.random() * points.length)];
@rbalazs
rbalazs / gist:7305636
Created November 4, 2013 16:55
Gets n number on a circle, calculated by the function parameters.
/**
* Returns with the required amount of points on the circle, caluclated by the center and radius parameter.
*
* @param {Object} center Center.
* @param {number} radius Radius.
* @param {number} numberOfPoints Number of point required.
*
* @returns {Array} An array, containing the point.
*/
getPointOnCircle = function (center, radius, numberOfPoints) {
<?php
// A query without any settings will use default values.
// This will result in a "*:*" query, 10 rows, all fields.
$query = new Solarium_Query_Select;
$result = $client->select($query);
echo 'Number of results found: ' . $result->getNumFound();
// The resultset is iterable, you could also use $result->getDocuments() to get an array with documents.
@rbalazs
rbalazs / fabfile.py
Created November 21, 2014 07:45
Ahogyanagyi.hu DEPLY
from fabric.api import *
def deploy_from_version_control():
""" Sync """
with cd("/var/www/ahogyanagyi/"):
run("git add .")
run("git reset --hard")
run("git pull")
run("php composer.phar install")
./configure --prefix=/usr/local \
--sysconfdir=/etc/php5 \
--with-config-file-path=/etc/php5/ \
--with-config-file-scan-dir=/etc/php5/conf.d \
--disable-debug \
--enable-bcmath \
--enable-calendar \
--enable-dba \
--enable-exif \
--enable-fpm \
bazsekdev2 (file://ARKON-LT-xx/Users/richer.balazs/VirtualBox%20VMs/bazsekdev2)
keycode 49 = iacute Iacute backslash bar less greater
keycode 94 = 0 section doublelowquotemark rightdoublequotemark notsign notsign grave asciitilde
clear mod1
keycode 133 = Alt_L Meta_L Alt_L Meta_L
add mod1 = Alt_L
clear mod4
keycode 64 = Super_L
keycode 108 = Super_R
keycode 8 =
keycode 9 = Escape NoSymbol Escape NoSymbol Escape
keycode 10 = 1 apostrophe 1 exclam asciitilde dead_tilde
keycode 11 = 2 quotedbl 2 at dead_caron caron
keycode 12 = 3 plus 3 numbersign asciicircum dead_circumflex
keycode 13 = 4 exclam 4 dollar dead_breve breve
keycode 14 = 5 percent 5 percent dead_abovering degree
keycode 15 = 6 slash 6 asciicircum dead_ogonek ogonek
keycode 16 = 7 equal 7 ampersand grave dead_grave
keycode 17 = 8 parenleft 8 asterisk dead_abovedot abovedot
!setxkbmap
keycode 8 =
keycode 9 = Escape NoSymbol Escape NoSymbol Escape
keycode 10 = 1 apostrophe 1 exclam asciitilde dead_tilde
keycode 11 = 2 quotedbl 2 at dead_caron caron
keycode 12 = 3 plus 3 numbersign asciicircum dead_circumflex
keycode 13 = 4 exclam 4 dollar dead_breve breve
keycode 14 = 5 percent 5 percent dead_abovering degree
keycode 15 = 6 slash 6 asciicircum dead_ogonek ogonek
@rbalazs
rbalazs / install.sh
Created April 29, 2017 10:06
PHP 5.6 on UBUNTU 16.04
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-get install php5.6
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml