Skip to content

Instantly share code, notes, and snippets.

// settings
@columns: 16;
@bodyWidth: 960px;
@columnMargin: 10px;
@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.
*/
@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>
<?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();
<?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']);
@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]*)/");
@sergej-brazdeikis
sergej-brazdeikis / gist:2736455
Created May 20, 2012 02:50
vk.com video search
<?php
/*
* Search video library by title
* @var $title string
* @return array List of videos
*/
public function search($title)
{
$html = $this->gb->get('http://vk.com/video?q='.htmlentities(urlencode($title)).'&section=search');
@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:2733550
Created May 20, 2012 02:17
vk.com video grabber
<?php
/**
* Vk.com video script
* - it searches for the movie
* - it gets embed code
*
* @author Sergej Jevsejev
* @url http://sjevsejev.blogspot.com
*/