Skip to content

Instantly share code, notes, and snippets.

View greg606's full-sized avatar
:octocat:
already replaced by AI

Greg Szczotka greg606

:octocat:
already replaced by AI
View GitHub Profile
<?php
class User_Model_Users implements Iterator, Countable
{
protected $_count;
protected $_gateway;
protected $_resultSet;
public function __construct($results, $gateway)
<tr><td><%= link_to(f.question - f.answer, {:controller => "flashcards", :action => "show", :id => f.id }, :class => "flashcard") %></td></tr>
<!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});
@greg606
greg606 / clear-float.css
Created April 26, 2012 12:22
modern semantic css clear float
.group:after {
visibility: hidden;
display: block;
content: "";
clear: both;
height: 0;
}
* html .group { zoom: 1; } /* IE6 */
*:first-child+html .group { zoom: 1; } /* IE7 */
@greg606
greg606 / cheat-sheet.txt
Last active August 17, 2017 14:25
cheat sheet
##### 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"
@greg606
greg606 / php.snippets
Created August 27, 2012 22:37 — forked from neotohin/php.snippets
CodeIgniter PHP snippets for the VIM plugin SnipMate
# 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
@greg606
greg606 / gist:3691559
Created September 10, 2012 15:31
get youtube video id
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");
}
}
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
}
})
}
@greg606
greg606 / gist:4002111
Created November 2, 2012 15:43
ubuntu vim solarized
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"
@greg606
greg606 / gist:4002157
Created November 2, 2012 15:47
git colors
#Just add the following to ~/.gitconfig:
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green