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 | |
| CURL="/usr/bin/curl" | |
| GAWK="/opt/local/bin/gawk" | |
| echo "Please pass the url you want to measure: " | |
| read url | |
| URL="$url" | |
| result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL` | |
| echo " Time_Connect Time_startTransfer Time_total " | |
| echo $result | $GAWK -F: '{ print $1" "$2" "$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 page = require('webpage').create(); | |
| var address; | |
| if(phantom.args.length < 1) { | |
| console.log("You need to give me a link, man"); | |
| phantom.exit(); | |
| } else { | |
| address = phantom.args[0]; | |
| page.open(address, function(status) { | |
| if(status !== 'success') { |
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
| #!/usr/bin/env ruby | |
| # encoding: utf-8 | |
| require 'fileutils' | |
| require 'pathname' | |
| require 'paperclip-strip-strange-characters' | |
| WORKING_DIR = Pathname.getwd | |
| dir_to_glob = 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
| #!/usr/bin/env ruby -W0 | |
| # encoding: utf-8 | |
| require 'fileutils' | |
| require 'pathname' | |
| require 'paperclip-strip-strange-characters' | |
| filename = ARGV[0] | |
| ext = File.extname(filename) |
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
| #referenced fields | |
| referenced_color_fields = ['palette', 'dominantcolor', 'searchbycolors', 'mostsaturated', ] | |
| referenced_text_fields = ['references', 'exhibitionHistory', 'notes'] | |
| work_keys = ["id", "accessionNumber", "artist", "catalogueEntry", "catalogueRaisonne", "classification", "creditLine", "culture", "date", "description", "designer", "dimensions", "dynasty", "galleryLabel", "geography", "imageUrl", "imgfilename", "markings", "medium", "period", "provenance", "reign", "rightsReproduction", "title", "workid", "workurl"] | |
| for item in r.iter_lines(): | |
| work_dict = json.loads(item) | |
| #work dict copy for new work model creation |
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
| <?php | |
| //get directory from argv | |
| $dir = $argv[1]; | |
| $db = $argv[2]; | |
| $collection = $argv[3]; | |
| //file handle | |
| $filehandle = opendir($dir); | |
| $counter = 1; |
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 | |
| # log into your server | |
| ssh root@[server ipaddress] | |
| # change root password | |
| passwd | |
| # update all packages and operating system | |
| apt-get update && apt-get --yes upgrade |
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
| #From: http://djangosnippets.org/snippets/2208/ | |
| #Author: cominataci, http://djangosnippets.org/users/cominatchu/ | |
| from django.http import HttpResponse | |
| from django.contrib.auth.decorators import login_required | |
| class AllowJSONPCallback(object): | |
| """This decorator function wraps a normal view function | |
| so that it can be read through a jsonp callback. | |
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
| <!doctype html> | |
| <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
| <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
| <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
| <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <title></title> | |
| <meta name="description" content=""> |
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
| // Works.proto | |
| package CG.Works; | |
| // Work | |
| message Work { | |
| required int32 id = 16 | |
| required string accessionNumber = 17 | |
| optional string artist = 18 | |
| optional string catalogueEntry = 19 | |
| optional string catalogueRaisonne = 20 |