Periodic git commit

This commit is contained in:
RussellChamp committed 2015-10-13 08:23:17 -05:00
1 parent 0b5a4fcfb8
commit 94127052c9
15 files changed
+169 -85

No files matched your search

-21
View File
@@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Who chats and when?</title>
</head>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script>
<script type="text/javascript">
userData = {};
jQuery.getJSON("/~krowbar/data/userData.json", function(json) {
userData = json;
});
</script>
<body>
Here's some stuff! Check the console for userData
<br/>
Maybe I should use Google charts again instead of D3. Remember to use .setUTCSeconds()
</body>
</html>
-26
View File
@@ -1,26 +0,0 @@
How do do stuff
Data structure
users["name"]
.talked = array of irc times
.mentioned = array of irc times
DATA DAEMON
* Parse log for nicks that said something
- Populate data structure
* For each line, log the person who talked
- Check if any other person was mentioned
- Only log if it is at least 1 minute past their last chat/reference (maybe
to reduce data size)
* Write to log file
- Same file or dated one?
- Only certain time frames??
* Run daily/hourly?
PRESENTATION
* Select a user name from the drop down
- See a timeline with colored strands of when they spoke and were mentioned
* Something that looks like the Github commit history
* Use D3 for coolness
+62 -8
View File
@@ -1,6 +1,35 @@
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<div>
<select id="series">
<option value="">Today</option>
<option value="_2015_09">Sep 2015</option>
<option value="_2015_08">Aug 2015</option>
<option value="_2015_07">July 2015</option>
<option value="_2015_06">June 2015</option>
<option value="_2015_05">May 2015</option>
<option value="_2015_04">Apr 2015</option>
<option value="_2015_03">Mar 2015</option>
<option value="_2015_02">Feb 2015</option>
<option value="_2015_01">Jan 2015</option>
<option value="_2014_12">Dec 2014</option>
<option value="_2014_11">Nov 2014</option>
<option value="_2014_10">Oct 2014</option>
<option value="_all_time">All Time</option>
</select>
<select id="howMuch">
<option value=0>All words</option>
<option value=1>Less words</option>
<option value=2>Lesser words</option>
<option value=3>Lessest words</option>
<select>
<button type="button"
onclick="getWords('/~krowbar/data/chatcloud' + document.getElementById('series').value + '.json',
document.getElementById('howMuch').value)"
>Generate Cloud</button>
</div>
<div id="cloud"></div>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.js"></script>
<script type="text/javascript" src="d3.layout.cloud.js"></script>
@@ -8,30 +37,54 @@
<script>(function() {
var fill = d3.scale.category20();
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
layout = d3.layout.cloud();
jQuery.getJSON("/~krowbar/data/chatcloud.json", function(json) {
maxSize = 10; //default
getWords = function(source, fraction) {
jQuery.getJSON(source, function(json) {
delete json.length; //if one of our words is the word "length", it messes up the count
jsonWords = [];
maxCount = _.max(json);
minCount = _.min(json);
if(source.indexOf('_') == -1) {
var d = new Date();
jsonWords.push({text: months[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear(), size: maxCount+1});
}
//eliminate the bottom 10% * fraction items
threshold = minCount + Math.floor(( maxCount - minCount) * fraction / 10);
console.log("Out of",_.size(json), "words from", source, "with count", minCount, "to", maxCount,": adding words at least",threshold);
//console.log(json);
data = json;
_.forEach(json, function(count, word) {
console.log("Added", word, count);
jsonWords.push({text: word, size: count});
if(isNaN(count)) { console.log("DANGER!:", word, "is", count); };
if(count >= threshold) {
//console.log("Added", word, count);
jsonWords.push({text: word, size: count});
}
});
maxSize = Math.sqrt(maxCount);
layout
.size([1200, 800])
.words(jsonWords)
.padding(5)
.padding(3)
.rotate(function() { return ~~(Math.random() * 2) * 90; })
.font("Impact")
.fontSize(function(d) { return d.size * 2 / 3; })
.fontSize(function(d) { return Math.sqrt(d.size) * 50 / maxSize + 6; })
.on("end", draw);
layout.start();
});
})};
getWords("/~krowbar/data/chatcloud.json", 1);
draw = function(words) {
console.log("Started draw with", words);
d3.select("body").append("svg")
console.log("Started draw with", words.length, "words");
d3.select("svg").remove();
d3.select("#cloud").append("svg")
.attr("width", layout.size()[0])
.attr("height", layout.size()[1])
.append("g")
@@ -50,3 +103,4 @@ draw = function(words) {
}
})();</script>
</body>
+13 -5
View File
@@ -1,14 +1,22 @@
<html>
<head>
<title>WIP</title>
<title>~krowbar's home page</title>
</head>
<body>
<h2>I just clobbered my index.html file</h2>
<h3>New site some time soon</h3>
Links and stuff
<ul>
<li><a href="chatchecker/">Tilde.town IRC Chat checker</a></li>
<li><a href="twine2/">Twine 2.0</a></li>
<li><a href="mission/">Mission name generator</a></li>
<li><a href="Grimoire/">Grimoire: The Pathfinder Item Roller</a></li>
<li><a href="grimoire/app/">Grimoire: The Pathfinder Item Roller</a></li>
<li><a href="https://github.com/RussellChamp/PragmaticDiceBag">Pragmatic Dice Bag</a></li>
</ul>
<h2><a href="chatcloud/">Tilde.town IRC Chat cloud</a></h2>
<iframe width=1200 height=800 frameborder=0 scrolling="no" src="chatcloud/"></iframe>
<h2><a href="mission/">Mission name generator</a></h2>
<iframe width=1200 height=200 frameborder=0 scrolling="no" src="mission/"></iframe>
<h2><a href="du/">Tilde.town disk usage</a></h2>
<iframe width=1200 height=1200 frameborder=0 scrolling="no" src="du/"></iframe>
</body>
+9 -5
View File
@@ -7,20 +7,24 @@
var self = this;
var adjectives = Array('Bold','Breaking','Brilliant','Crescent','Dark|Darkness','Desert|Desert','Evening|Darkness','Final','First','July','Last','Libery|Liberty','Magic|Magic','Morning|Morning','Power|Power','Phantom','Present','Roaring|Roar|Scream','Rolling','Sand','Screaming','Soaring','Standing|Stand','Star|Star','Urgent','Utopian','Valiant');
var nouns = Array('Action','Alert','Beauty','Claw','Darkness','Dawn','Day','Desert','Envy','Fall','Fist','Flight','Fury','Guard','Hammer','Hand','Honor','Hope','Hurricane','Liberty','Light','Lightning','Magic','Morning','October','Power','Rain','Repose','Roar','Scream','Skull','Shield','Stand','Star','Storm','Streak','Sun','Thunder','Wind','Wrath');
var colors = Array('Black','Blue','Brown','Gray','Green','Indego','Orange','Purple','Rainbow','Red','Scarlet','Violet','White','Yellow');
var actors = Array('Condor','Eagle','Guardian','Hawk','Hydra','Lady','Lion','Scorpion','Spartan','Titan','Victor','Viking','Warrior');
var adjectives = Array('Bold','Breaking','Brilliant','Crescent','Dark|Darkness','Desert|Desert','Eternal','Evening|Darkness','Final','First','Forever','Glorious','Joyful','July','Last','Libery|Liberty','Magic|Magic','Morning|Morning','Power|Power','Phantom','Present','Roaring|Roar|Scream','Rolling','Sand','Screaming|Roar|Scream','Soaring','Standing|Stand','Star|Star','Twisted','Urgent','Utopian','Valiant');
var nouns = Array('Action','Alert','Beauty','Claw','Darkness','Dawn','Day','Desert','Envy','Fall','Fist','Flight','Fury','Guard','Hammer','Hand','Honor','Hope','Hurricane','Liberty','Light','Lightning','Magic','Morning','October','Power','Rain','Repose','Roar','Scream','Skull','Sky','Skies','Shield','Stand','Star','Storm','Streak','Strike','Sun','Thunder','Victory','Whisper','Wind','Wrath');
var colors = Array('Black','Blue','Brown','Gray','Green','Indego','Orange','Purple','Rainbow','Red','Scarlet','Silver','Violet','White','Yellow');
var actors = Array('Cobra','Condor','Dragon','Eagle','Guardian','Hawk','Hydra','Jackal','King','Knight','Lady','Lion','Scorpion','Spartan','Titan','Victor','Viking','Warrior');
var mission_grammars = Array(
{chance:30, grammar: 'adj1 + " " + noun1'},
{chance:20, grammar: 'adj1 + " " + actor'},
{chance:10, grammar: 'color + " " + noun1'},
{chance:10, grammar: 'color + " " + actor'},
{chance:10, grammar: 'actor +"\'s " + noun1'},
{chance:10, grammar: 'noun1 + " of the " + noun2'},
{chance:10, grammar: 'noun1 + " of the " + actor'},
{chance:10, grammar: 'actor + " of the " + noun1'},
{chance:10, grammar: 'noun1 + " of " + noun2'},
{chance:10, grammar: 'noun1 + " of " + color + " " + noun2'},
{chance:10, grammar: 'adj1 + " " + noun1 + " and " + adj2 + " " + noun2'},
{chance:3, grammar: '"Attack of the " + actor + "s"'}
{chance:3, grammar: '"Attack of the " + actor + "s"'},
{chance:3, grammar: '"Return of the " + actor + "s"'}
);
this.getNoun = function(badNouns) {
return _.chain(nouns)