Skip to content

Instantly share code, notes, and snippets.

View j0rdm4n's full-sized avatar

Abou Mohamed j0rdm4n

  • Morroco
View GitHub Profile
#~ # -*- coding: utf-8 -*-
from urlparse import urlparse, parse_qs
from django.template import Template, Context
from django.conf import settings
def video_id(value):
"""
<head >
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script>
<script type="text/javascript">
function PhoneListCtrl($scope, $http){
var dataurl ='http://gdata.youtube.com/feeds/api/videos?q="string%20calculator"%20kata%20-tekpub%20-movie&orderby=rating&alt=json';
$http.get(dataurl).success(function(data){
/*
* Adapted from: http://code.google.com/p/gaequery/source/browse/trunk/src/static/scripts/jquery.autogrow-textarea.js
*
* Works nicely with the following styles:
* textarea {
* resize: none;
* word-wrap: break-word;
* transition: 0.05s;
* -moz-transition: 0.05s;
* -webkit-transition: 0.05s;
# i used this tutorial: http://www.tutorialspoint.com/python/python_database_access.htm
# clicked this link from that page to download the MySQL database connector for Python: http://sourceforge.net/projects/mysql-python/
# then i cd into ~/Downloads/MySQL-python-1.2.4b4
# python setup.py build
# python setup.py install
# now the connector should be installed correctly
# here's another good link: http://www.ianhowson.com/a-quick-guide-to-using-mysql-in-python.html
# then i can write the following script to connect to my practice db:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : 'YOUR_APP_URL_HERE', // App ID from the app dashboard
channelUrl : 'http://www.YOUR_DOMAIN_THINGY.com/channel.html', // Channel file for x-domain comms
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});
//Fetch Github Issues Using the YouTube API
function getGdlEvents(){
var channelID = "UC_x5XG1OV2P6uZZ5FSM9Ttw";
var yt = "https://www.googleapis.com/youtube/v3/activities";
var part = "snippet";
var maxResults = "50";
var key = "Your Google API Key";
var url = yt + "?part=" + part + "&channelId=" + channelID + "&maxResults=" + maxResults + "&key=" + key;
<?php
<?php
/**
* Plugin definition.
*
* Displays article search section.
*/
$plugin = array(
#include <algorithm>//copy
#include <cassert>//assert
#include <iostream>//cout
#include <iterator>//iterator
#include <limits>//numeric
#include <memory>//shared_ptr
#include <numeric>//accumelate
#include <random>//mt19937, distribution
#include <sstream>//stringstream;
#include <type_traits>//is_arithmetic
<?php
/**
* Ranking Library
* contains alogrithms for story ranking
* Basically a PHP Implementation of reddits algorithms
*
* @author Lucas Nolte <lnolte@i.biz>
* @since 0.1
* @package Polska Wiadomosc
* @subpackage Libraries