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
#Process most common words from web page, and output to file, using wget, sed, awk, sort command line utilities. | |
Using both sed #and awk methods provides greatest accuracy. Example is for YouTube video comments. | |
#sed stream editor method: | |
wget -O - https://gdata.youtube.com/feeds/api/videos/ffVbnPjl86A/comments?orderby=published \ | |
| sed -e 's/<[^>]*>//g' | tr -cs A-Za-z\' '\n' \ #clean up HTML tags; convert all to lowercase | |
| tr A-Z a-z | sort | uniq -c | sort -k1,1nr -k2 | sed ${1:-200}q > conan.txt | |
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 | |
#Fun with operators, conditionals and exported functions. Notes below. | |
y=$(date +%Y) | |
d=$(date +%d) | |
m=$(date +%m) | |
u=`whoami` | |
s=`pwd` | |
if [ $d -lt 25 ] && [ $m == 12 ] && [[ "$s" == *"home/phoebe/shell"* ]] | |
then |
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
/* DHT 11 temperature/humidity sensor, 16-character 2-line LCD screen with message relating to weather conditions, | |
processed by Uno R3 microcontroller. | |
Watch related video on my YouTube channel, and post comment. Thanks! | |
http://youtube.com/user/p1nesap | |
Sensor out to pin 2. SCL to A5, SDA to A4. | |
1st i2c_scan, put address # in LiquidCrystal_I2C below. | |
*/ | |
#include <Wire.h> // communicate with sensors |
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
/* | |
Code by Tom Igoe with voltage/LCD sections by p1nesap. Watch on YouTube: | |
https://www.youtube.com/watch?v=MlS9Arac9jM | |
*/ | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> |
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 createDoc() { | |
var doc = DocumentApp.getActiveDocument(); | |
var body = doc.getBody(); | |
//Put your unique API key in UNIQUE_KEY section below | |
var url = "https://www.googleapis.com/youtube/v3/channels?id=UNIQUE_KEY&part=statistics&fields=items(statistics(viewCount, subscriberCount))"; | |
var response = UrlFetchApp.fetch(url); | |
var astext = response.getContentText(); | |
//var nobrak = astext.replace(/[\])}[{(]/g, ''); | |
//var strip = astext.replace(/[\(\)\[\]{},'"]/g,"").replace("items:", "").replace("statistics:", "").replace("viewCount", "Total Views").replace("subscriberCount", "Subscribers"); |
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
//calls createDoc function from YouTubeAPI.gs and updates every 6 hours. | |
function createTimeDrivenTriggers() { | |
ScriptApp.newTrigger('createDoc') | |
.timeBased() | |
.everyHours(6) | |
.create(); | |
} |
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
#!/usr/bin/env python | |
import cgi | |
import time | |
import datetime | |
import re | |
import cgitb; #cgitb.enable() | |
print "Content-type: text/html" | |
today = datetime.date.today() |
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
<head> | |
<style> | |
body { | |
background-color: #fffafa; | |
color: #162252; | |
font-family: arial; | |
font-size: 16px; | |
margin: 15px 15px 25px 25px; | |
} | |
</style> |
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
//Code by Mike McCauley ([email protected]) Copyright (C) 2008 Mike McCauley | |
//with LCD sections by P1nesap on YouTube: https://youtu.be/Q2iECOsfCqA | |
#include <VirtualWire.h> | |
#include <LiquidCrystal_I2C.h> | |
#include <Wire.h> | |
void setup() | |
{ | |
Serial.begin(9600); // Debugging only | |
Serial.println("setup"); |
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
// Copyright (C) 2008 Mike McCauley | |
//with additional sections for LCD by P1nesap on Youtube: https://youtu.be/Q2iECOsfCqA | |
#include <VirtualWire.h> | |
#include <LiquidCrystal_I2C.h> | |
#include <Wire.h> | |
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address |
OlderNewer