Skip to content

Instantly share code, notes, and snippets.

View infyloop's full-sized avatar

infyloop

View GitHub Profile
<html>
<head>
<title>Flapper News</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.10/angular-ui-router.js"></script>
<script src="app.js"></script>
<style> .glyphicon-thumbs-up { cursor:pointer } </style>
</head>
@infyloop
infyloop / .gitignore
Created September 21, 2012 05:50 — forked from eykd/.gitignore
Full stack BDD testing with Behave+Mechanize+Django
*.pyc
bin/
include/
lib/
@infyloop
infyloop / gist:2843461
Created May 31, 2012 13:35
Sample HTML page with Twitter's Bootstrap, Ryan Fait's Sticky Footer, and a full-width footer
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="author" content="Martin Bean" />
<title>Twitter&rsquo;s Bootstrap with Ryan Fait&rsquo;s Sticky Footer</title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<style>
html, body {
height: 100%;
@infyloop
infyloop / csvreader.py
Created May 15, 2012 12:32
helps to read a csv file in python
myfile = open("../myfile.csv", "rb")
reader = csv.reader(myfile)
for row in reader:
if rownum == 0:
header = row
# depending upon the format of the csv file you might have to split things as well, if the file is not formatted properly, which generally is the case.
else:
colnum = 0
@infyloop
infyloop / jqsnippet
Created March 5, 2012 11:02
my collection of js often re-used snippets
// will get the id of the elements in the checkbox iff they are selected.
the html should be:
<input type="checkbox" name="check_box_17" value="17">
<input type="checkbox" name="check_box_18" value="18">
<input type="checkbox" name="check_box_19" value="19">
$("#delete-clients").click(function() {
var arc = [];
$("input:checked").each(function(i, obj) { arc.push($(obj).val()) });
Problem Statement:
a user belongs to one/many user_groups and one/many user_types
a channel belongs to one/many user_groups and one/many user_types
a video belongs to one/many channels
when a user logs in, he should be showed video from the channel which matches his user_group and user_type.
Solution done in django shell:
uobj = UserProfile.objects.get(user__username = "**")
ug = uobj.belongs_to_user_group
ut = uobj.belongs_to_user_type.all()
@infyloop
infyloop / gist:1286383
Created October 14, 2011 06:20
Buffered List
/*
*
* Author: Scott Borduin, Lioarlan, LLC
* License: GPL (http://www.gnu.org/licenses/gpl.html) -or- MIT (http://www.opensource.org/licenses/mit-license.php)
*
* Release: 0.15
*
* Acknowledgement: Based partly on public contributions from members of the Sencha.com bulletin board.
*
/*
*
* Author: Scott Borduin, Lioarlan, LLC
* License: GPL (http://www.gnu.org/licenses/gpl.html) -or- MIT (http://www.opensource.org/licenses/mit-license.php)
*
* Release: 0.15
*
* Acknowledgement: Based partly on public contributions from members of the Sencha.com bulletin board.
*