Skip to content

Commit 403f9a9

Browse files
committed
Small tweaks
1 parent 2558daf commit 403f9a9

File tree

4 files changed

+78
-104
lines changed

4 files changed

+78
-104
lines changed

assets/application.js

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,37 @@
1-
(function ($) {
1+
(function ($, undefined) {
2+
// Put custom repo URL's in this object, keyed by repo name.
3+
var repoUrls = {
4+
"bootstrap": "http://twitter.github.com/bootstrap/",
5+
"hogan.js": "http://twitter.github.com/hogan.js/"
6+
};
7+
8+
function repoUrl(repo) {
9+
return repoUrls[repo.name] || repo.html_url;
10+
}
11+
12+
// Put custom repo descriptions in this object, keyed by repo name.
13+
var repoDescriptions = {
14+
"bootstrap": "Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.",
15+
"chainsaw": "Chainsaw is a thin Scala wrapper on top of SLF4J. It provides support for var-args and for lazy args, and for easily creating Logger instances.",
16+
"configgy": "Configgy is a library for handling config files and logging for a scala daemon. The idea is that it should be simple and straightforward, allowing you to plug it in and get started quickly.",
17+
"finagle": "Finagle is an asynchronous network stack for the JVM that you can use to build asynchronous Remote Procedure Call (RPC) clients and servers in Java, Scala, or any JVM-hosted language. Finagle provides a rich set of tools that are protocol independent.",
18+
"flockdb": "FlockDB is a distributed directed graph store built with Gizzard on MySQL. It's useful for storing and retrieving relationship edges between entities and their intersections. Twitter uses it to store user to user, user to tweet, and tweet to tweet relationships.",
19+
"gizzard": "Gizzard is a flexible sharding framework for creating eventually-consistent distributed datastores. It allows for easier scaling of any data storage system, e.g. MySQL or Redis. Twitter uses it to store tweets, relationships, and timeline data.",
20+
"gizzmo": "Gizzmo is a command line tool for managing Gizzard clusters. It is used to create tables, sharding structures and topologies in Gizzard. Twitter uses it to manage all our clusters.",
21+
"haplocheirus": "Haplocheirus is a Redis-backed storage engine for timelines.",
22+
"kestrel-client": "kestrel-client is a library that allows you to talk to a Kestrel queue server from ruby. As Kestrel uses the memcache protocol, kestrel-client is implemented as a wrapper around the memcached gem.",
23+
"naggati2": 'Naggati (Inuktitut for "make fit") is a protocol builder for netty, using scala 2.8.',
24+
"pycascading": "PyCascading is a Python wrapper for Cascading that allows you to control the full data processing workflow from Python.",
25+
"sbt-scrooge": "sbt-scrooge is an sbt plugin that adds a mixin for doing thrift code auto-generation during your compile phase."
26+
};
27+
28+
function repoDescription(repo) {
29+
return repoDescriptions[repo.name] || repo.description;
30+
}
31+
232
function addRecentlyUpdatedRepo(repo) {
333
var $item = $("<li>");
4-
$item.append('<span class="name"><a href="' + repo.html_url + '">' + repo.name + '</a></span>');
34+
$item.append('<span class="name"><a href="' + repoUrl(repo) + '">' + repo.name + '</a></span>');
535
$item.append('<span class="time"><a href="' + repo.html_url + '/commits">' + strftime("%h %e, %Y", repo.pushed_at) + '</a></span>');
636
$item.append('<span class="bullet">&sdot;</span>');
737
$item.append('<span class="watchers"><a href="' + repo.html_url + '/watchers">' + repo.watchers + ' watchers</a></span>');
@@ -10,13 +40,13 @@
1040
$item.appendTo("#recently-updated-repos");
1141
}
1242

13-
function addProject(project) {
14-
var $project = $("<div>").addClass("project grid-1");
15-
$project.addClass(project.language.toLowerCase());
16-
$project.append('<h2>' + project.name + '</h2>');
17-
$project.append('<h3>' + project.language + '</h3>');
18-
$project.append('<p>' + project.description + '</p>');
19-
$project.appendTo("#projects");
43+
function addRepo(repo) {
44+
var $item = $("<li>").addClass("repo grid-1 " + repo.language.toLowerCase());
45+
var $link = $("<a>").attr("href", repoUrl(repo)).appendTo($item);
46+
$link.append($("<h2>").text(repo.name));
47+
$link.append($("<h3>").text(repo.language));
48+
$link.append($("<p>").text(repoDescription(repo)));
49+
$item.appendTo("#repos");
2050
}
2151

2252
$.getJSON("https://api.github.com/users/twitter/repos?callback=?", function (result) {
@@ -30,15 +60,15 @@
3060
repo.pushed_at = new Date(repo.pushed_at);
3161
});
3262

33-
// Sort by most # of watchers.
63+
// Sort by highest # of watchers.
3464
repos.sort(function (a, b) {
3565
if (a.watchers < b.watchers) return 1;
3666
if (b.watchers < a.watchers) return -1;
3767
return 0;
3868
});
3969

4070
$.each(repos, function (i, repo) {
41-
addProject(repo);
71+
addRepo(repo);
4272
});
4373

4474
// Sort by most-recently pushed to.

assets/grid.css

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
body {
2-
min-width: 960px;
3-
}
4-
51
.grid-1, .grid-2, .grid-3, .grid-4 {
62
display:inline;
73
float: left;
@@ -10,13 +6,6 @@ body {
106
margin-right: 10px;
117
}
128

13-
.push-1, .pull-1,
14-
.push-2, .pull-2,
15-
.push-3, .pull-3,
16-
.push-4, .pull-4 {
17-
position: relative;
18-
}
19-
209
/* Grid >> Children (Alpha ~ First, Omega ~ Last) */
2110

2211
.alpha {
@@ -45,62 +34,6 @@ body {
4534
width: 940px;
4635
}
4736

48-
/* Prefix Extra Space >> 4 Columns */
49-
50-
.grid .prefix-1 {
51-
padding-left: 240px;
52-
}
53-
54-
.grid .prefix-2 {
55-
padding-left: 480px;
56-
}
57-
58-
.grid .prefix-3 {
59-
padding-left: 720px;
60-
}
61-
62-
/* Suffix Extra Space >> 4 Columns */
63-
64-
.grid .suffix-1 {
65-
padding-right: 240px;
66-
}
67-
68-
.grid .suffix-2 {
69-
padding-right: 480px;
70-
}
71-
72-
.grid .suffix-3 {
73-
padding-right: 720px;
74-
}
75-
76-
/* Push Space >> 4 Columns */
77-
78-
.grid .push-1 {
79-
left: 240px;
80-
}
81-
82-
.grid .push-2 {
83-
left: 480px;
84-
}
85-
86-
.grid .push-3 {
87-
left: 720px;
88-
}
89-
90-
/* Pull Space >> 4 Columns */
91-
92-
.grid .pull-1 {
93-
left: -240px;
94-
}
95-
96-
.grid .pull-2 {
97-
left: -480px;
98-
}
99-
100-
.grid .pull-3 {
101-
left: -720px;
102-
}
103-
10437
/* http://sonspring.com/journal/clearing-floats */
10538

10639
.clear {

assets/style.css

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ body {
66
font: 13px "Helvetica Neue", Helvetica, Arial, sans-serif;
77
line-height: 1.4;
88
color: #666;
9+
min-width: 960px;
910
}
1011

1112
h1 {
@@ -40,12 +41,12 @@ a:hover {
4041
text-align: center;
4142
}
4243

43-
#main, div.header, div.project {
44+
#main, div.header, li.repo {
4445
background: white;
4546
background: rgba(255, 255, 255, 0.7);
46-
-moz-box-shadow: 0px 0px 5px 0px #eee;
47-
-webkit-box-shadow: 0px 0px 5px 0px #eee;
48-
box-shadow: 0px 0px 5px 0px #eee;
47+
-moz-box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.15);
48+
-webkit-box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.15);
49+
box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.15);
4950
margin-bottom: 20px;
5051
}
5152

@@ -94,6 +95,10 @@ div.header h1 {
9495
line-height: 15px;
9596
}
9697

98+
#statistics a:link, #statistics a:visited {
99+
color: inherit;
100+
}
101+
97102
#statistics p.email {
98103
margin-top: 6px;
99104
font-size: 11px;
@@ -132,36 +137,42 @@ div.header h1 {
132137
color: #999;
133138
}
134139

135-
div.project {
140+
li.repo {
136141
height: 250px;
137142
}
138143

139-
div.project h2, div.project h3, div.project p {
144+
li.repo > a {
145+
display: block;
146+
width: 100%;
147+
height: 100%;
148+
overflow: hidden;
149+
text-decoration: none;
150+
color: inherit;
151+
}
152+
153+
li.repo a:hover {
154+
background: #efefef;
155+
background: rgba(0, 0, 0, 0.05);
156+
}
157+
158+
li.repo h2, li.repo h3, li.repo p {
140159
margin: 10px 15px;
141160
}
142161

143-
div.project h2 {
162+
li.repo h2 {
144163
margin-bottom: 2px;
145164
max-width: 160px;
146165
overflow: hidden;
147166
}
148167

149-
div.project h3 {
168+
li.repo h3 {
150169
font-size: 11px;
151170
margin-top: 2px;
152171
margin-bottom: 15px;
153172
color: #999;
154173
}
155174

156-
div.project-title {
157-
height: 30px;
158-
}
159-
160-
.project-description {
161-
162-
}
163-
164-
.project::after {
175+
.repo::after {
165176
content: '';
166177
position: absolute;
167178
right: 0;
@@ -171,24 +182,25 @@ div.project-title {
171182
border-bottom: 50px solid transparent;
172183
border-left: 50px solid transparent;
173184
border-right: 50px solid red;
185+
pointer-events: none;
174186
}
175187

176-
.project.javascript::after {
188+
.repo.javascript::after {
177189
border-right-color: #0080b0;
178190
}
179191

180-
.project.scala::after {
192+
.repo.scala::after {
181193
border-right-color: #7ac9de;
182194
}
183195

184-
.project.ruby::after {
196+
.repo.ruby::after {
185197
border-right-color: #b60202;
186198
}
187199

188-
.project.java::after {
200+
.repo.java::after {
189201
border-right-color: brown;
190202
}
191203

192-
.project.python::after {
204+
.repo.python::after {
193205
border-right-color: #6aad2d;
194206
}

index.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
</head>
1313
<body>
1414
<div id="wrapper" class="grid clearfix">
15-
1615
<div id="main" class="grid-1">
1716
<div id="logo"><h1>Twitter Open Source</h1></div>
1817
<h1>Twitter is built on open source software.</h1>
@@ -25,9 +24,9 @@ <h1>Twitter is built on open source software.</h1>
2524
<div id="statistics" class="grid-1 alpha header">
2625
<h1>Statistics</h1>
2726
<p>
28-
<span id="num-repos">&nbsp;</span> public repos
27+
<a href="https://github.com/twitter/repositories"><span id="num-repos">&nbsp;</span> public repos</a>
2928
<br>
30-
<span id="num-members">&nbsp;</span> members
29+
<a href="https://github.com/twitter"><span id="num-members">&nbsp;</span> members</a>
3130
</p>
3231
<p class="email"><a href="mailto:[email protected]">[email protected]</a></p>
3332
</div>
@@ -38,7 +37,7 @@ <h1>Recently updated <a href="https://github.com/twitter/repositories">View All
3837
</div>
3938
</div>
4039

41-
<div id="projects"></div>
40+
<ol id="repos"></ol>
4241
</div>
4342
</body>
4443
</html>

0 commit comments

Comments
 (0)