Skip to content

Instantly share code, notes, and snippets.

View ruslanas's full-sized avatar

Ruslanas Balčiūnas ruslanas

View GitHub Profile
/*
* jquery.suggest 1.1b - 2007-08-06
* Patched by Mark Jaquith with Alexander Dick's "multiple items" patch to allow for auto-suggesting of more than one tag before submitting
* See: http://www.vulgarisoip.com/2007/06/29/jquerysuggest-an-alternative-jquery-based-autocomplete-library/#comment-7228
*
* Uses code and techniques from following libraries:
* 1. http://www.dyve.net/jquery/?autocomplete
* 2. http://dev.jquery.com/browser/trunk/plugins/interface/iautocompleter.js
*
* All the new stuff written by Peter Vulgaris (www.vulgarisoip.com)
<?php
/**
* Downloads latest WordPress and extracts it to script folder
* @author Ruslanas Balčiūnas
*/
/* DELETE AFTER USAGE */
$fname = 'latest.tar.gz';
file_put_contents($fname, fopen('http://wordpress.org/latest.tar.gz', 'r'));
@ruslanas
ruslanas / stars.html
Created September 12, 2012 13:58
Programmers Day
<!DOCTYPE html>
<html>
<head>
<title>256</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script>
var canvas = null;
var ctx = null;
var stars = [
[200,185,"rgb(255,0,0)", 0, 0.1],
@ruslanas
ruslanas / typeahead_with_id.js
Created September 10, 2012 23:26
Typeahead with id
/*
* CakePHP Twitter Bootstrap Typeahead with id
* ProjectsController.php
* <?php $this->set('projects', $this->Project->find('list'); $this->render('list', 'ajax'); ?>
* /app/View/Projects/list.ctp
* <?php echo json_encode($projects); ?>
* data = {'id': 'item name', ..};
* /app/View/Tasks/index.ctp
* <input type="hidden" id="TaskProjectId" name="data[Task][project_id]"/>
* <input autocomplete="off" data-provide="typeahead" class="typeahead" type="search" id="TaskProject">