Skip to content

Instantly share code, notes, and snippets.

@sergej-brazdeikis
sergej-brazdeikis / gist:63737f9472c96ff30db0
Created November 17, 2014 15:14
Install VBoxGuestAddtions
wget http://download.virtualbox.org/virtualbox/4.3.18/VBoxGuestAdditions_4.3.18.iso
sudo mkdir /media/iso
sudo mount -o loop VBoxGuestAdditions_4.3.18.iso /media/iso
cd /media/iso/
sudo ./VBoxLinuxAdditions.run
<?php
namespace SJevs\LibBundle;
use SJevs\LibBundle\Preg;
/*
* Grabber with Tor functionality
*
@author Sergej Jevsejev
@sergej-brazdeikis
sergej-brazdeikis / gist:2733188
Created May 20, 2012 01:48
PHP Regular expression outputs string or array
<?php
namespace SJevs\LibBundle;
/*
@author Sergej Jevsejev
@url http://sjevsejev.blogspot.com
*/
class Preg
@sergej-brazdeikis
sergej-brazdeikis / gist:2736092
Created May 20, 2012 02:46
vk.com video construct
<?php
function __construct($login, $password, $phoneLast4Digits)
{
$this->$phoneLast4Digits = $phoneLast4Digits;
$this->gb = new Grabber();
$data = $this->gb->post('http://login.vk.com/?act=login',
array(
'act' => 'login',
@sergej-brazdeikis
sergej-brazdeikis / gist:2736766
Created May 20, 2012 02:53
vk.com video play
<?php
/*
* Returns iframe code to play video
* Note: some videos are unable to embed because of particular video settings
*/
public function play($id1, $id2)
{
// getting hash
$hash = $this->gb->getPregOne('http://vk.com/video'.$id1.'_'.$id2, "/hash2[^0-9a-f]*([0-9a-f]*)/");
<?php
$vk = new vk($login, $password, $phoneLast4Digits);
// Get array of the movies
$videos = $vk->search('The Avatar');
// get iframe code for any movie from array
$html = $vk->play($videos[0]['id1'], $videos[0]['id2']);
<?php
if ($detect->isIpad()) {
// code to run for the iPad platform
}
if ($detect->isIphone()) {
// code to run for the iPhone platform
}
if ($detect->isAndroid()) {
<?php
include("Mobile_Detect.php");
$detect = new Mobile_Detect();
@sergej-brazdeikis
sergej-brazdeikis / jquery.html
Created June 10, 2012 16:47
JQuery from CDN
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
@sergej-brazdeikis
sergej-brazdeikis / grid960.less
Created July 14, 2012 09:25
grid 960 using less.js
/*
rewriten to less.js by Sergej Jevsejev
@date 2012 07 14
@webpage http://sjevsejev.blogspot.com
960 Grid System ~ Core CSS.
Learn more ~ http://960.gs/
Licensed under GPL and MIT.
*/