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> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script> | |
<style type="text/css"> | |
textarea#text { | |
outline: none; | |
border:none; |
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
require 'rubygems' | |
require 'oauth' | |
require 'json' | |
#install the above dependencies with rubygems - | |
#gem install dependency | |
#You will need these for OAuth. The second of each should be your secret value. The naming simply refects the order in the two OAuth class constructors. Create an app in the Twitter dev centre to get these values, making sure you select the option for 'read and write access'. | |
CONSUMER_KEY1 = "" #consumer key | |
CONSUMER_KEY2 = "" #consumer secret |
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
require 'rubygems' | |
require 'oauth' | |
require 'json' | |
#You will need these for OAuth. The second of each should be your secret value. The naming simply refects the order in the two OAuth class constructors. | |
CONSUMER_KEY1 = "" #consumer key | |
CONSUMER_KEY2 = "" #consumer secret | |
ACCESS_TOKEN1 = "" #access token | |
ACCESS_TOKEN2 = "" #access secret |
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
require 'rubygems' | |
require 'oauth' | |
require 'json' | |
#You will need to add your keys below and your username where indicated inside the method. | |
CONSUMER_KEY1 = "" #consumer key | |
CONSUMER_KEY2 = "" #consumer secret | |
ACCESS_TOKEN1 = "" #access token | |
ACCESS_TOKEN2 = "" #access secret |
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
from random import randint | |
board = [] | |
print ''' | |
Welcome to Battleship! First, let's set up the board... | |
''' | |
board_size = raw_input("What board size do you want to play?") | |
board_size = int(board_size) |
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 xhrGet(reqUri, callback, type) { | |
var caller = this.caller; | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", reqUri, true); | |
if(type){ | |
xhr.responseType = type; | |
} |
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 Guitar(make, year, sound){ | |
this.make = make; | |
this.year = year; | |
this.sound = sound; | |
this.playChord = function(){ | |
alert(this.sound); | |
} | |
}; | |
var anduril = new Guitar("Fender Squier", 1985, "Brang!"); |
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
require 'uri' | |
require 'rest_client' | |
class DatabaseDetails | |
attr_accessor :database_name, :username, :password, :port | |
def initialize(database_name, username = nil, password = nil, port = nil) | |
@database_name = database_name | |
@username = username || 'admin' | |
@password = password || 'admin' |
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
task :upload_single_file do | |
# database connections | |
fuseki = FusekiConnection.new('glasgow-development', nil, nil, 3030) | |
stardog = StardogConnection.new('glasgow-development') | |
file = File.read("#{FusekiExport.template_app_root}/data_backup/postcodes.ttl") | |
graph_uri_string = "http://linked.glasgow.gov.uk/graph/postcodes" | |
# begin transaction with basic Stardog superuser creds | |
begin_transaction_response = RestClient.post "http://#{stardog.username}:#{stardog.password}@localhost:#{stardog.port}/#{stardog.database_name}/transaction/begin", {:accept => :text} |
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 | |
# First, create a folder: /var/run/monit | |
# Then, make sure your user or group owns it: chown user:user /var/run/monit | |
# USAGE: | |
# use option one to start or stop | |
# use option two as the docker name | |
# use option three as the docker run command it follows '-d' f you are starting a container | |
# |
OlderNewer