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
import urllib2 | |
from bs4 import BeautifulSoup | |
page = urllib2.urlopen('http://www.bbc.co.uk/sport/football/tables') | |
soup = BeautifulSoup(page) | |
rows = soup.find_all('tr') | |
for row in rows: | |
team = row.find('td', class_='team-name') |
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
// use like <%= commitsha1 %> | |
grunt.registerTask('githash', function () { | |
var done = this.async(), | |
config; | |
config = { | |
cmd: 'git', | |
args: ['rev-parse', '--verify', 'HEAD'] | |
}; |
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
var browserSync = require('browser-sync'), | |
common = require('./__common__'), | |
gulp = require('gulp'), | |
watch = require('gulp-watch'); | |
gulp.task('default', [ | |
'less' | |
], function () { | |
browserSync({ | |
server: { |
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
var cwd = process.cwd(), | |
path = require('path'); | |
module.exports = function (config) { | |
config.set({ | |
basePath: cwd, | |
browsers: [ | |
'Chrome' | |
], | |
files: [ |
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
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) | |
/******/ return installedModules[moduleId].exports; |
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
public function check_youtube_url($s, $c=FALSE) | |
{ | |
$page = 'youtube.com/watch?'; | |
$player = 'youtube.com/v/'; | |
$short = 'youtu.be/'; | |
$clean = str_replace( array( 'http://', 'www.' ), '', $s ); | |
if ( strpos( $clean, $page ) === 0 ) | |
{ |
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
var el = document.createElement( 'div' ); | |
el.setAttribute( 'ontouchstart', 'return;' ); | |
if ( typeof el.ontouchstart == 'function' ) | |
{ | |
// yay a touch device! | |
} |
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
var timer = setInterval( function() | |
{ | |
if ( /loaded|complete/.test( document.readyState ) ) | |
{ | |
clearInterval( timer ); | |
// go! | |
} | |
}, 10 ); |
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
function scrollGetCoords(e) | |
{ | |
var coors; | |
if ( e.hasOwnProperty( 'originalEvent' ) ) | |
{ | |
e = e.originalEvent; | |
} | |
if ( e.touches && e.touches.length ) |
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
#!/usr/bin/env python | |
import logging | |
import urllib | |
def serialise_model(m, d): | |
# let's serialise this bad boy | |
ps = m.properties() | |
# check if we're dealing with a list or not |