Skip to content

Instantly share code, notes, and snippets.

View ascott's full-sized avatar
✌️
👌 🌊 ☕️

Alanna Scott ascott

✌️
👌 🌊 ☕️
View GitHub Profile
@ascott
ascott / README.md
Last active September 27, 2016 04:35 — forked from syntagmatic/README.md
Hypersolids as PNG's
@ascott
ascott / reps-scraped-072316.json
Last active July 24, 2016 06:32
scrape-us-rep-data.js
{
"reps":[
{
"district":"1",
"name":"Byrne, Bradley",
"url":"https://byrne.house.gov/",
"party":"R",
"phone":"202-225-4931",
"committees":"Armed Services\nEducation and the Workforce\nRules"
},
@ascott
ascott / percentage-female.rb
Last active February 8, 2017 23:14
percentage of female artists at the Tate Modern.
# tate-modern-artists.csv can be retrieved here:
# https://raw.githubusercontent.com/tategallery/collection/master/artist_data.csv
require('CSV')
male = 0
female = 0
CSV.foreach("tate-modern-artists.csv") do |row|
if row[2] == "Male"
male = male + 1
@ascott
ascott / exportjson.js
Created February 29, 2012 04:41 — forked from pamelafox/exportjson.js
Google Spreadsheet JSON Export
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
function exportAllSheets() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var sheetsData = {};
for (var i = 0; i < sheets.length; i++) {
var sheet = sheets[i];
var rowsData = getRowsData_(sheet);
@ascott
ascott / wp_is_user_admin.php
Created June 17, 2011 02:37
wordpress - add a class to an element if user is admin
<?php
get_currentuserinfo(); 
//add_users is a capability only admins have - http://codex.wordpress.org/Roles_and_Capabilities#Administrator
if (!current_user_can( 'add_users' )) {
//set admin class
$adminclass = 'is_admin';
}
else {
$adminclass = '';