Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcec0d7f

Browse files
committed
new deployment
1 parentb710ba3 commitcec0d7f

File tree

9 files changed

+207
-26
lines changed

9 files changed

+207
-26
lines changed

‎404/index.html‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ <h1>Page not found</h1>
1616
<p>The page you were looking for was not found.</p>
1717
</div>
1818

19-
<footerclass="container">
19+
<footerclass="container padv">
2020
<p><ahref="/">CoderStats</a> is a free service that displays statistics for coders with public Git repositories on GitHub.<br>
21-
<ahref="https://github.com/coderstats/coderstats.net">Source Code</a>
21+
<ahref="https://github.com/coderstats/coderstats.net">Source Code</a>
2222
<ahref="https://chrome.google.com/webstore/detail/necogepejonacpphmlmcagmbjaogpbng">Chrome Extension</a><ahref="https://addons.mozilla.org/en-US/firefox/addon/coderstats/">Firefox Add-on</a><ahref="https://teespring.com/stores/codershirts"title="T-Shirts, hoodies, mugs and stickers for coders">CoderShirts Store</a>
2323
</footer>
2424

25-
<scriptsrc="//unpkg.com/vue@2.4.4/dist/vue.min.js"></script>
26-
<scriptsrc="//unpkg.com/vue-resource@1.3.4/dist/vue-resource.min.js"></script>
27-
<scriptsrc="//d3js.org/d3-collection.v1.min.js"></script>
28-
<scriptsrc="//d3js.org/d3-array.v1.min.js"></script>
25+
<scriptsrc="//cdn.jsdelivr.net/npm/vue"></script>
26+
<scriptsrc="//cdn.jsdelivr.net/npm/vue-resource@1.5.1/dist/vue-resource.min.js"></script>
27+
<scriptsrc="//cdn.jsdelivr.net/npm/d3-collection@1.0.7/dist/d3-collection.min.js"></script>
28+
<scriptsrc="//cdn.jsdelivr.net/npm/d3-array@2.2.0/dist/d3-array.min.js"></script>
2929
</body>
3030
</html>

‎compiled/coder.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎compiled/coder.js‎

Lines changed: 142 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,142 @@
1-
constDEV=0;letbar_options={axisX:{onlyInteger:!0},axisY:{offset:100,showGrid:!1},horizontalBars:!0,reverseData:!0},github_user=null;document.location.hash?github_user=document.location.hash.replace('#',''):document.location.href='/',document.title=`CoderStats(${github_user})`,document.getElementsByClassName('brand')[0].textContent=document.title;leturl_user=`https://api.github.com/users/${github_user}`,url_repos=`${url_user}/repos?sort=pushed&per_page=100`,months_short=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];letcoder=newVue({el:'#coder',data:{repos:[],response:{},sort_orders:{},sort_key:'',user:null},computed:{repos_pushed:function(){returnthis.repos.filter((a)=>a.pushed_at>a.created_at)},repos_pushed_ratio:function(){returnthis.repos.length?this.repos_pushed.length/this.repos.length:0},languages:function(){returnd3.nest().key((a)=>a.language).rollup((a)=>a.length).entries(this.repos_pushed.filter((a)=>a.language)).sort((c,a)=>a.value-c.value)},issues:function(){returnthis.repoRanking('open_issues_count')},forks:function(){returnthis.repoRanking('forks_count')},stars:function(){returnthis.repoRanking('stargazers_count')},total_forks:function(){returnd3.sum(this.forks,(a)=>a.forks_count)},total_issues:function(){returnd3.sum(this.issues,(a)=>a.open_issues_count)},total_stars:function(){returnd3.sum(this.stars,(a)=>a.stargazers_count)}},filters:{fixURL:(a)=>(a.startsWith('http')||(a=`http://${a}`),a),formatDate:(a)=>{letb=newDate(a);return`${b.getDate()}${months_short[b.getMonth()]}${b.getYear()+1900}`},formatURL:(a)=>a.split('://').pop().replace(/\/$/,'')},created:function(){this.fetchRepos(),this.fetchUser()},updated:function(){leta=this.languages.slice(0,10);newChartist.Bar('#language-ranking',{labels:a.map((a)=>a.key),series:[a.map((a)=>a.value)]},bar_options),this.rankingGraph(this.issues.slice(0,10),'open_issues_count','#issues-ranking'),this.rankingGraph(this.forks.slice(0,10),'forks_count','#forks-ranking'),this.rankingGraph(this.stars.slice(0,10),'stargazers_count','#stars-ranking')},methods:{fetchRepos:function(){this.$http.get(url_repos).then((a)=>{this.response.repos=a,this.repos=a.body})},fetchUser:function(){this.$http.get(url_user).then((a)=>{this.response.user=a,this.user=a.body,this.user.name||(this.user.name=this.user.login)})},order:function(a){return0>this.sort_orders[a]?'dsc':'asc'},rankingGraph:function(a,b,c){a.length&&newChartist.Bar(c,{labels:a.map((a)=>a.name),series:[a.map((a)=>a[b])]},bar_options)},repoRanking:function(c){returnthis.repos_pushed.filter((a)=>a[c]).sort((d,a)=>a[c]-d[c])},sortBy:function(c,d='number'){lete='string'===d?'':0;this.sort_key=c,this.sort_orders[c]=-1*(this.sort_orders[c]||1),this.repos.sort((f,a)=>{letb=f[c]||e,g=a[c]||e;return'string'===d&&(b=b.toLowerCase(),g=g.toLowerCase()),(b===g?0:b>g?1:-1)*this.sort_orders[c]})}}});
1+
constDEV=0;
2+
3+
letbar_options={
4+
axisX:{onlyInteger:true},
5+
axisY:{offset:100,showGrid:false},
6+
horizontalBars:true,
7+
reverseData:true
8+
};
9+
10+
letgithub_user=null;
11+
if(document.location.hash){
12+
github_user=document.location.hash.replace('#','');
13+
}else{
14+
document.location.href='/';
15+
}
16+
// Set these values here because they are outside of vue's scope.
17+
document.title=`CoderStats(${github_user})`;
18+
document.getElementsByClassName('brand')[0].textContent=document.title;
19+
20+
leturl_user=`https://api.github.com/users/${github_user}`,
21+
url_repos=`${url_user}/repos?sort=pushed&per_page=100`,
22+
months_short='Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
23+
24+
if(DEV){
25+
url_user='/data/user.json';
26+
url_repos='/data/repos.json';
27+
}
28+
29+
letcoder=newVue({
30+
el:'#coder',
31+
data:{
32+
repos:[],
33+
response:{},
34+
sort_orders:{},
35+
sort_key:'',
36+
user:null
37+
},
38+
computed:{
39+
// Only repos the user actually pushed at, i.e. no forks with no user commits.
40+
repos_pushed:function(){
41+
returnthis.repos.filter(d=>d.pushed_at>d.created_at);
42+
},
43+
repos_pushed_ratio:function(){
44+
returnthis.repos.length ?this.repos_pushed.length/this.repos.length :0;
45+
},
46+
languages:function(){
47+
returnd3.nest().key(d=>d.language).rollup(leaves=>leaves.length).entries(this.repos_pushed.filter(d=>d.language)).sort((a,b)=>b.value-a.value);
48+
},
49+
issues:function(){
50+
returnthis.repoRanking('open_issues_count');
51+
},
52+
forks:function(){
53+
returnthis.repoRanking('forks_count');
54+
},
55+
stars:function(){
56+
returnthis.repoRanking('stargazers_count');
57+
},
58+
total_forks:function(){
59+
returnd3.sum(this.forks,d=>d.forks_count);
60+
},
61+
total_issues:function(){
62+
returnd3.sum(this.issues,d=>d.open_issues_count);
63+
},
64+
total_stars:function(){
65+
returnd3.sum(this.stars,d=>d.stargazers_count);
66+
}
67+
},
68+
filters:{
69+
fixURL:value=>{
70+
if(!value.startsWith('http')){
71+
value=`http://${value}`;
72+
}
73+
returnvalue;
74+
},
75+
formatDate:value=>{
76+
letdt=newDate(value);
77+
return`${dt.getDate()}${months_short[dt.getMonth()]}${dt.getYear()+1900}`;
78+
},
79+
formatURL:value=>{
80+
returnvalue.split('://').pop().replace(/\/$/,'');
81+
}
82+
},
83+
created:function(){
84+
this.fetchRepos();
85+
this.fetchUser();
86+
},
87+
updated:function(){
88+
letlanguage_ranking=this.languages.slice(0,10);
89+
newChartist.Bar('#language-ranking',{
90+
labels:language_ranking.map(d=>d.key),
91+
series:[language_ranking.map(d=>d.value)]
92+
},bar_options);
93+
94+
this.rankingGraph(this.issues.slice(0,10),'open_issues_count','#issues-ranking');
95+
this.rankingGraph(this.forks.slice(0,10),'forks_count','#forks-ranking');
96+
this.rankingGraph(this.stars.slice(0,10),'stargazers_count','#stars-ranking');
97+
},
98+
methods:{
99+
fetchRepos:function(){
100+
this.$http.get(url_repos).then(response=>{
101+
this.response.repos=response;
102+
this.repos=response.body;
103+
});
104+
},
105+
fetchUser:function(){
106+
this.$http.get(url_user).then(response=>{
107+
this.response.user=response;
108+
this.user=response.body;
109+
if(!this.user.name)this.user.name=this.user.login;
110+
});
111+
},
112+
order:function(key){
113+
// asc is default, because sort orders are initially unset
114+
returnthis.sort_orders[key]<0 ?'dsc' :'asc';
115+
},
116+
rankingGraph:function(series,property,selector){
117+
if(series.length){
118+
newChartist.Bar(selector,{
119+
labels:series.map(d=>d.name),
120+
series:[series.map(d=>d[property])]
121+
},bar_options);
122+
}
123+
},
124+
repoRanking:function(property){
125+
returnthis.repos_pushed.filter(d=>d[property]).sort((a,b)=>b[property]-a[property]);
126+
},
127+
sortBy:function(key,type='number'){
128+
letdefault_value=type==='string' ?'' :0;
129+
this.sort_key=key;
130+
this.sort_orders[key]=(this.sort_orders[key]||1)*-1;
131+
this.repos.sort((a,b)=>{
132+
letx=a[key]||default_value,
133+
y=b[key]||default_value;
134+
if(type==='string'){
135+
x=x.toLowerCase();
136+
y=y.toLowerCase();
137+
}
138+
return(x===y ?0 :x>y ?1 :-1)*this.sort_orders[key];
139+
});
140+
}
141+
}
142+
});

‎compiled/events.js‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1-
letevents=newVue({el:'#events',data:{events:null,response:null},computed:{users:function(){returnd3.nest().key((a)=>a.actor.login).entries(this.events.filter((a)=>'PushEvent'===a.type)).sort((c,a)=>a.values.length-c.values.length)}},created:function(){this.fetchEvents()},methods:{fetchEvents:function(){this.$http.get('https://api.github.com/events').then((a)=>{this.response=a,this.events=a.body})}}});
1+
letevents=newVue({
2+
el:'#events',
3+
data:{
4+
events:null,
5+
response:null
6+
},
7+
computed:{
8+
users:function(){
9+
returnd3.nest().key(d=>d.actor.login).entries(this.events.filter(d=>d.type==='PushEvent')).sort((a,b)=>b.values.length-a.values.length);
10+
}
11+
},
12+
created:function(){
13+
this.fetchEvents();
14+
},
15+
methods:{
16+
fetchEvents:function(){
17+
leturl='https://api.github.com/events';
18+
//url = '/data/events.json';
19+
this.$http.get(url).then(response=>{
20+
this.response=response;
21+
this.events=response.body;
22+
});
23+
}
24+
}
25+
});

‎compiled/search.js‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
letsearch=newVue({el:'#search',data:{username:''},methods:{coder:function(){this.username&&(document.location.href=`/github#${this.username}`)}}});
1+
letsearch=newVue({
2+
el:'#search',
3+
data:{
4+
username:''
5+
},
6+
methods:{
7+
coder:function(){
8+
if(this.username){
9+
document.location.href=`/github#${this.username}`;
10+
}
11+
}
12+
}
13+
});

‎compiled/style.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎github/index.html‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<divv-if="user"class="flex">
3232
<divclass="sidebar padh">
3333
<header>
34-
<h4>{{ user.name }}</h4>
34+
<h3>{{ user.name }}</h3>
3535
</header>
3636
<img:src="user.avatar_url":alt="user.name"class="img-fluid">
3737
<p>Joined GitHub {{ user.created_at|formatDate }}</p>
@@ -130,7 +130,11 @@ <h2 id="repos">Repositories</h2>
130130
<tbody>
131131
<trv-for="(repo, idx) in repos_pushed":title="repo.description">
132132
<td>{{ idx + 1}}</td>
133-
<td><strong><av-bind:href="repo.html_url">{{ repo.name }}</a></strong><iv-if="repo.fork"class="fa fa-code-fork"aria-hidden="true"></i></td>
133+
<td>
134+
<strong><av-bind:href="repo.html_url">{{ repo.name }}</a></strong>
135+
<iv-if="repo.fork"class="fa fa-code-fork"aria-hidden="true"title="Forked Repository"></i>
136+
<iv-if="repo.archived"class="fa fa-archive"aria-hidden="true"title="Archived Repository"></i>
137+
</td>
134138
<td>{{ repo.language }}</td>
135139
<tdclass="text-right">{{ repo.created_at | formatDate }}</td>
136140
<tdclass="text-right">{{ repo.pushed_at | formatDate }}</td>
@@ -149,16 +153,16 @@ <h2 id="repos">Repositories</h2>
149153

150154
</div>
151155

152-
<footerclass="container">
156+
<footerclass="container padv">
153157
<p><ahref="/">CoderStats</a> is a free service that displays statistics for coders with public Git repositories on GitHub.<br>
154-
<ahref="https://github.com/coderstats/coderstats.net">Source Code</a>
158+
<ahref="https://github.com/coderstats/coderstats.net">Source Code</a>
155159
<ahref="https://chrome.google.com/webstore/detail/necogepejonacpphmlmcagmbjaogpbng">Chrome Extension</a><ahref="https://addons.mozilla.org/en-US/firefox/addon/coderstats/">Firefox Add-on</a><ahref="https://teespring.com/stores/codershirts"title="T-Shirts, hoodies, mugs and stickers for coders">CoderShirts Store</a>
156160
</footer>
157161

158-
<scriptsrc="//unpkg.com/vue@2.4.4/dist/vue.min.js"></script>
159-
<scriptsrc="//unpkg.com/vue-resource@1.3.4/dist/vue-resource.min.js"></script>
160-
<scriptsrc="//d3js.org/d3-collection.v1.min.js"></script>
161-
<scriptsrc="//d3js.org/d3-array.v1.min.js"></script>
162+
<scriptsrc="//cdn.jsdelivr.net/npm/vue"></script>
163+
<scriptsrc="//cdn.jsdelivr.net/npm/vue-resource@1.5.1/dist/vue-resource.min.js"></script>
164+
<scriptsrc="//cdn.jsdelivr.net/npm/d3-collection@1.0.7/dist/d3-collection.min.js"></script>
165+
<scriptsrc="//cdn.jsdelivr.net/npm/d3-array@2.2.0/dist/d3-array.min.js"></script>
162166

163167
<scriptsrc="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
164168
<scriptsrc="/compiled/coder.js"></script>

‎index.html‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ <h2>Recently active users</h2>
3737
</div>
3838
</div>
3939

40-
<footerclass="container">
40+
<footerclass="container padv">
4141
<p><ahref="/">CoderStats</a> is a free service that displays statistics for coders with public Git repositories on GitHub.<br>
42-
<ahref="https://github.com/coderstats/coderstats.net">Source Code</a>
42+
<ahref="https://github.com/coderstats/coderstats.net">Source Code</a>
4343
<ahref="https://chrome.google.com/webstore/detail/necogepejonacpphmlmcagmbjaogpbng">Chrome Extension</a><ahref="https://addons.mozilla.org/en-US/firefox/addon/coderstats/">Firefox Add-on</a><ahref="https://teespring.com/stores/codershirts"title="T-Shirts, hoodies, mugs and stickers for coders">CoderShirts Store</a>
4444
</footer>
4545

46-
<scriptsrc="//unpkg.com/vue@2.4.4/dist/vue.min.js"></script>
47-
<scriptsrc="//unpkg.com/vue-resource@1.3.4/dist/vue-resource.min.js"></script>
48-
<scriptsrc="//d3js.org/d3-collection.v1.min.js"></script>
49-
<scriptsrc="//d3js.org/d3-array.v1.min.js"></script>
46+
<scriptsrc="//cdn.jsdelivr.net/npm/vue"></script>
47+
<scriptsrc="//cdn.jsdelivr.net/npm/vue-resource@1.5.1/dist/vue-resource.min.js"></script>
48+
<scriptsrc="//cdn.jsdelivr.net/npm/d3-collection@1.0.7/dist/d3-collection.min.js"></script>
49+
<scriptsrc="//cdn.jsdelivr.net/npm/d3-array@2.2.0/dist/d3-array.min.js"></script>
5050

5151
<scriptsrc="/compiled/events.js"></script>
5252
<scriptsrc="/compiled/search.js"></script>

‎rss.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<channel><title>RSS Feed</title>
44
<link>http://localhost:8080</link>
55
<description>RSS Feed</description>
6-
<lastBuildDate>Sat, 23 Sep 2017 21:03:10 </lastBuildDate>
6+
<lastBuildDate>Sun, 26 May 2019 01:20:06 </lastBuildDate>
77
<generator>Logya</generator>
88
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
99
<item>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp