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 bash | |
# Generates an RSS feed for a list of audio files, for consumption by Overcast | |
# and other podcast players. | |
# | |
# Usage: make-audio-feed TITLE BASE_URL FILE... | |
# Example: (cd directory && make-audio-feed 'My Audio Files' 'https://your.server/directory/' * > .feed.rss) | |
set -eu -o pipefail |
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>Banned</title> | |
<style> | |
body { | |
width: 35em; | |
margin: 0 auto; | |
font-family: Tahoma, Verdana, Arial, sans-serif; | |
} |
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
// this is (a start of) an example of a Susy+mq() setup that mimics bootstrap grid. | |
// I work on multiple bootstrap-based projects. | |
// I want to stop using grid classes in the markup, and start using mixins with susy and sass-mq. | |
// Since the project is heavily tied to the bootstrap grid, I want to have the exact same behavior | |
// between bootstrap classes (old code) and susy mixins (new code). | |
// all the grid classes generated below are here to ease up testing. | |
// required: susy + sass-mq |
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 | |
header('Content-Type: application/rss+xml; charset=UTF-8'); | |
// suck in the query string variables | |
$feed_name = htmlspecialchars($_GET['fname']); | |
$list_name = htmlspecialchars($_GET['lname']); | |
// compose the api urls + other stuff depending on presence of playlist | |
if(isset($_GET['lname'])) { | |
$json_url = 'http://api.mixcloud.com/'.$feed_name.'/playlists/'.$list_name.'/cloudcasts/'; |
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
app.directive('infiniteScroll', [ | |
'$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) { | |
return { | |
link: function(scope, elem, attrs) { | |
var checkWhenEnabled, handler, scrollDistance, scrollEnabled; | |
$window = angular.element($window); | |
elem.css('overflow-y', 'scroll'); | |
elem.css('overflow-x', 'hidden'); | |
elem.css('height', 'inherit'); | |
scrollDistance = 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
<?php | |
# Fill our vars and run on cli | |
# $ php -f db-connect-test.php | |
$dbname = 'name'; | |
$dbuser = 'user'; | |
$dbpass = 'pass'; | |
$dbhost = 'host'; | |
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); |
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
#!/bin/bash | |
TOKEN="Get token from https://cloud.digitalocean.com/settings/applications" | |
DOMAIN=example.com | |
RECORD_ID=12345 | |
IP=`curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+'` | |
# to get record id: | |
# curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" "https://api.digitalocean.com/v2/domains/$DOMAIN/records" |
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
/** | |
* Hide the addressbar on ios & android devices | |
* https://gist.github.com/yckart/5609969 | |
* | |
* Based on the work from Nate Smith | |
* @see https://gist.github.com/nateps/1172490 | |
* | |
* Copyright (c) 2013 Yannick Albert (http://yckart.com) | |
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php). | |
* 2013/07/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
#!/bin/bash | |
while read FILENAME; do | |
LCOV_INPUT_FILES="$LCOV_INPUT_FILES -a \"$FILENAME\"" | |
done < <( find $1 -name lcov.info ) | |
eval lcov "${LCOV_INPUT_FILES}" -o $1/$2 |
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 | |
$curl = curl_init(); | |
curl_setopt_array($curl, Array( | |
CURLOPT_URL => 'http://blogs.guggenheim.org/map/feed/', | |
CURLOPT_USERAGENT => 'spider', | |
CURLOPT_TIMEOUT => 120, | |
CURLOPT_CONNECTTIMEOUT => 30, | |
CURLOPT_RETURNTRANSFER => TRUE, |
NewerOlder