Skip to content

Instantly share code, notes, and snippets.

View lmccart's full-sized avatar
🍊

Lauren Lee McCarthy lmccart

🍊
View GitHub Profile
@lmccart
lmccart / gist:a29c88800c8e0779d78e
Created March 5, 2015 19:26
wikipedia iframe example
<html>
<head>
<script src="jquery.js"/></script>
<script>
$(document).ready(function() {
$('#show').click(function() {
$('#wiki').fadeIn();
})

The internet is full of impostors, unreliable narrators, replicas, spoofers, parodies, and stories that present fiction as fact. Some things that started as fiction become fact, and this also happens in reverse. In conversation, current and former residents Joanne McNeil and Lauren McCarthy will discuss their work and give examples of the murky space between real and fake.

pplkpr

crowdpilot

@lmccart
lmccart / gist:80eb61b40551f51d72ec
Created February 13, 2015 19:46
language chat
socket.on('user message', function(msg){
console.log('msg: '+msg);
var url = 'https://www.googleapis.com/language/translate/v2?key=INSERT-YOUR-KEY&source=en&target=de&q='+encodeURI(msg);
restclient.get(url, function(data) {
socket.emit('bot message', data.translations[0].translatedText);
});
});
var x = 300;
var y = 300;
var speed = 0;
var input;
var button;
var url = "http://api.openweathermap.org/data/2.5/weather?q=";
function setup() {
createCanvas(windowWidth, windowHeight);
background(200);
// http://www.alchemyapi.com/api/sentiment/proc.html
var http = require('http');
//Create the AlchemyAPI object
var AlchemyAPI = require('./alchemyapi');
var alchemyapi = new AlchemyAPI();
var demo_text = 'Yesterday dumb Bob destroyed my fancy iPhone in beautiful Denver, Colorado. I guess I will have to head over to the Apple Store and buy a new one.';
// example calling API twice for two difference sentences
var s = 'The cat is mad.';
$.getJSON(s, params, function(data) {
console.log(data);
});
s = 'I am very old and tired and sad.'
$.getJSON(s, params, function(data) {
console.log(data);
////// JQUERY
// openweathermap
$(document).ready(function(){
$.getJSON("http://api.openweathermap.org/data/2.5/weather?id=5128581&units=imperial", function(data) {
alert("Temperature is: " + data.main.temp );
});
});
// nytimes
@lmccart
lmccart / index.html
Last active November 16, 2017 15:53
drag and drop with p5.js!
<html>
<head>
<script type="text/javascript" src="p5.js"></script>
<script type="text/javascript" src="p5.dom.js"></script>
<script type="text/javascript">
function setup() {
var c = createCanvas(400, 400);
devicePixelScaling(false);
background(0);
textSize(40);
@lmccart
lmccart / gist:b7b10dc6dad6736aefc9
Created February 4, 2015 21:29
2/4 class snippets
var text = "The shore line was peaceful and flat, and the calm sea bumped it playfully along the sandy beach. In the distance a beautiful island covered with palm trees and flowers beckoned invitingly from the sparkling water. Nothing can possibly go wrong now, cried the Humbug happily, and as soon as he'd said it he leaped from the car, as if stuck by a pin, and sailed all the way to the little island. And we'll have plenty of time,'' answered Tock, who hadn't noticed that the bug was missing--and he, too, suddenly leaped into the air and disappeared. It certainly couldn't be a nicer day, agreed Milo, who was too busy looking at the road to see that the others had gone. And in a split second he was gone also.";
var words = text.split(" ");
var sentences = text.split(/[.?!;:]/);
//var sentences = text.split(/and|if|the/);
console.log("There are "+words.length+" words.");
console.log("There are "+sentences.length+" sentences.");
package com.example.lmccart.glassolalia;
import com.google.android.glass.media.Sounds;
import com.google.android.glass.widget.CardBuilder;
import com.google.android.glass.widget.CardScrollAdapter;
import com.google.android.glass.widget.CardScrollView;
import com.google.android.glass.content.Intents;
import android.app.Activity;
import android.content.Context;