This file contains 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 | |
/** | |
* 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 |
This file contains 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
#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 |
This file contains 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 | |
<?php | |
/** | |
* Plugin definition. | |
* | |
* Displays article search section. | |
*/ | |
$plugin = array( |
This file contains 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
//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; | |
This file contains 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
<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 | |
}); |
This file contains 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
# 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: |
This file contains 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
/* | |
* 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; |
This file contains 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
<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){ |
This file contains 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
#~ # -*- coding: utf-8 -*- | |
from urlparse import urlparse, parse_qs | |
from django.template import Template, Context | |
from django.conf import settings | |
def video_id(value): | |
""" |
This file contains 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> | |
<head> | |
<title>Self-expanding textarea</title> | |
</head> | |
<body> | |
<textarea id="expand" rows="8" cols="40"></textarea> | |
<script type="text/javascript" charset="utf-8"> | |
var textarea = document.getElementById('expand') | |
var div = document.createElement('div') |
OlderNewer