This file contains hidden or 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
; <<>> DiG 9.8.3-P1 <<>> dailybruin.com | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9189 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 | |
;; QUESTION SECTION: | |
;dailybruin.com. IN A | |
;; AUTHORITY SECTION: |
This file contains hidden or 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 | |
API_URL="http://freegeoip.net/csv/" | |
# Get current external IP (http://askubuntu.com/a/95911) | |
IP=$(curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//') | |
LOCATION=$(curl -s ${API_URL}${IP}) | |
echo "$LOCATION" | awk -F "," '{print $6 ",", $5 ",", $3}' |
This file contains hidden or 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 http = require('http'); | |
var fs = require('fs'); | |
var argv = require('yargs').argv; | |
var cheerio = require('cheerio'); | |
var DEFAULT_TEMPLATE = "http://uclabruins.com/ViewArticle.dbml?ATCLID=209624560&DB_OEM_ID=30500"; | |
var template = argv.template || DEFAULT_TEMPLATE; | |
var pageFilename = argv._[0]; |
This file contains hidden or 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
<style> | |
#article-content h1 { | |
float: left; | |
margin-right: 1rem; | |
} | |
#article-content h2 { | |
color: #666; | |
} |
This file contains hidden or 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
.fullwidth { | |
width: 100vw; | |
margin-left: calc((100vw - $wrapper_width)/-2); | |
} |
This file contains hidden or 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 request = require('superagent'); | |
var React = require('react'); | |
// require('./app.scss'); | |
var API_ROOT = '/api/'; | |
var App = React.createClass({ |
This file contains hidden or 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 ALL_SPORTS = "[all sports]"; | |
var ALL_YEARS = "[all years]"; | |
var FilterableChampionshipList = React.createClass({ | |
getInitialState: function() { | |
return { | |
viewingSport: ALL_SPORTS, | |
viewingYear: ALL_YEARS | |
}; | |
}, |
This file contains hidden or 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
def list(self, request, *args, **kwargs): | |
# get the base url without any query params | |
url = request.path | |
params = [] | |
# build a list of 2-value tuples which contains query params | |
for key, value in request.GET.iteritems(): | |
params.append((key, value)) | |
if params: | |
# sort the params so e.g., ?bunny=cute&fox=sly is treated as the | |
# same key as ?fox=sly&bunny=cute |
This file contains hidden or 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 astContains(ast, nodeType) { | |
walk(ast, function(node) { | |
if (node.type === nodeType) | |
return true; | |
}); | |
return false; | |
} |