This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gconftool-2 --set "/apps/gnome-terminal/profiles/Profile0/use_theme_background" --type bool false | |
gconftool-2 --set "/apps/gnome-terminal/profiles/Profile0/use_theme_colors" --type bool false | |
gconftool-2 --set "/apps/gnome-terminal/profiles/Profile0/palette" --type string "#070736364242:#D3D301010202:#858599990000:#B5B589890000:#26268B8BD2D2:#D3D336368282:#2A2AA1A19898:#EEEEE8E8D5D5:#00002B2B3636:#CBCB4B4B1616:#58586E6E7575:#65657B7B8383:#838394949696:#6C6C7171C4C4:#9393A1A1A1A1:#FDFDF6F6E3E3" | |
gconftool-2 --set "/apps/gnome-terminal/profiles/Profile0/background_color" --type string "#00002B2B3636" | |
gconftool-2 --set "/apps/gnome-terminal/profiles/Profile0/foreground_color" --type string "#65657B7B8383" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_youtube_metadata (id) { | |
$.getJSON('https://gdata.youtube.com/feeds/api/videos/'+ id +'?v=2&alt=json', function (data){ | |
return { | |
name: data.entry.title.$t, | |
thumb: data.entry.media$group.media$thumbnail[0].url | |
} | |
}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_youtube_url(url){ | |
var regExp = /http[s]?:\/\/(?:[^\.]+\.)*(?:youtube\.com\/(?:v\/|watch\?(?:.*?\&)?v=|embed\/)|youtu.be\/)([\w\-\_]+)/i; | |
var match = url.match(regExp); | |
if (match&&match[1].length==11){ | |
return match[1]; | |
}else{ | |
alert("incorrect url"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SnipMate is required to use snippets | |
# Download SnipMate: http://www.vim.org/scripts/script.php?script_id=2540 | |
# Put this file in ~/.vim/snippets/ then restart vim | |
# This snippet file includes many useful snippets for CodeIgniter. Please feel free to fork and contribute! | |
snippet php | |
<?php | |
${1} | |
snippet ec | |
echo "${1:string}"${2}; | |
snippet inc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### symfony | |
sudo composer create-project symfony/framework-standard-edition path/to/install | |
php app/console cache:clear --env=prod --no-debug | |
php app/console assets:install --symlink web/ | |
php app/console generate:bundle --namespace=Creaticon/HelloBundle | |
php app/console doctrine:database:create | |
php app/console doctrine:schema:update --force | |
php app/console doctrine:generate:entity --entity="AcmeStoreBundle:Product" --fields="name:string(255) price:float description:text" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.group:after { | |
visibility: hidden; | |
display: block; | |
content: ""; | |
clear: both; | |
height: 0; | |
} | |
* html .group { zoom: 1; } /* IE6 */ | |
*:first-child+html .group { zoom: 1; } /* IE7 */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script src="/socket.io/lib/socket.io.js"></script> | |
<script> | |
$(document).ready(function() { | |
var socket = io.connect('http://localhost', {port: 8080}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr><td><%= link_to(f.question - f.answer, {:controller => "flashcards", :action => "show", :id => f.id }, :class => "flashcard") %></td></tr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User_Model_Users implements Iterator, Countable | |
{ | |
protected $_count; | |
protected $_gateway; | |
protected $_resultSet; | |
public function __construct($results, $gateway) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
preg_match('@^(?:http://)?([^/]+)@i', $_SERVER['HTTP_HOST'], $matches); | |
$host = $matches[1]; | |
if($host != 'localhost') | |
die('Jakiś komunikat albo nie'); | |
?> | |
Strona.... |