xonecas.io
2495
Xg

xonecas.github.com / commit 5797763

Added more stuffs

xonecas2013-02-24 5797763be076cc0ebc4f6a61b502469a4e8f8b38 parent 9ce5b7c

15 files changed

_includes/buttons.html+6−0
@@ -0,0 +1,6 @@
1+<!-- github -->
2+<iframe src="http://ghbtns.com/github-btn.html?user=xonecas&type=follow&count=false" allowtransparency="true" frameborder="0" scrolling="0" width="250" height="30"></iframe>
3+<!-- twitter -->
4+<p><a href="https://twitter.com/xonecas" class="twitter-follow-button" data-show-count="false" data-dnt="true">Follow @xonecas</a></p>
5+<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
6+
_layouts/default.html+12−11
@@ -3,30 +3,31 @@
33 <head>
44 <title>Sean Caetano Martin</title>
55 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6- <link href="/css/bootstrap.min.css" rel="stylesheet">
76 <link href="/css/bootstrap-responsive.min.css" rel="stylesheet">
87 <link href="/css/pygments.css" rel="stylesheet">
98 <link href="/css/styles.css" rel="stylesheet">
109 </head>
11- <body>
10+ <body style="display: none;">
1211 <div class="container">
13- <div class="page-header">
12+ <div class="hero-unit">
1413 <h1>
15- Sean Caetano Martin
16- <small>@xonecas</small>
14+ A place for code and tech.
1715 </h1>
1816 </div>
1917
2018 <div class="navbar">
2119 <div class="navbar-inner">
22- <ul class="nav">
23- <li class="active">
20+ <div class="container">
21+ <span class="brand custom-font">Sean Caetano Martin</span>
22+ <ul class="nav">
23+ <li>
2424 <a href="/">Blog</a>
25- </li>
26- <li>
25+ </li>
26+ <li>
2727 <a href="/work.html">Work</a>
28- </li>
29- </ul>
28+ </li>
29+ </ul>
30+ </div>
3031 </div>
3132 </div>
3233
_layouts/post.html+4−1
@@ -14,7 +14,7 @@ layout: default
1414 </li>
1515 {% endfor %}
1616 </ul>
17- <h3>Related Posts</h3>
17+ <h3>Related</h3>
1818 <ul class="nav nav-pills nav-stacked">
1919 {% for post in site.related_posts limit:3 %}
2020 <li>
@@ -25,6 +25,9 @@ layout: default
2525 </li>
2626 {% endfor %}
2727 </ul>
28+
29+ {% include buttons.html %}
30+
2831 </div>
2932 <div class="span10">
3033 {{ content }}
_posts/2011-07-19-creativejs.com-three.js-tutorial.markdown+14−0
@@ -0,0 +1,14 @@
1+---
2+layout: post
3+---
4+
5+Creativejs - Three.js tutorial
6+------------------------------
7+
8+San Jose, Aug 19, 2011
9+
10+I completed [this](http://creativejs.com/tutorials/three-js-part-1-make-a-star-field/) tutorial. You can see the end result [here](//xonecas.com/creativejs-threejs-part1/), although it has been modified because I did my homework.
11+
12+At the end of the tutorial Seb challenges everyone to do some exercises (homework): change the direction, shape, color and angle of the particles.
13+
14+For a deeper look on what is going on there, check out the [Github repo](https://github.com/xonecas/creativejs-threejs-part1). The evolution of the code is neatly organized with (git) tags.
_posts/2011-07-20-fractal-tree.markdown+10−0
@@ -0,0 +1,10 @@
1+---
2+layout: post
3+---
4+
5+Fractal tree
6+------------
7+
8+San Jose, Aug 20, 2011
9+
10+Credits go to [Christian Heilmann](http://twitter.com/codepo8) for making the [original](http://t.co/NcEGMRd). I made [this](//xonecas.com/fractal-tree/) to learn how he did the tree, and to play around with Twitter Bootstrap and smoke.js.
_posts/2011-09-19-binary-search-twitter-size.markdown+33−0
@@ -0,0 +1,33 @@
1+---
2+layout: post
3+---
4+
5+Binary Search, Twitter size
6+---------------------------
7+
8+`function f(a,v,l,h){var m;return hv ? f(a,v,l, m-1): a[m] &lt; v ? f(a,v,m+1,h): m; }`
9+
10+And it works too!
11+
12+Using the binary operator `~~` I'm able to ditch `Math.floor()` and I replaced `false` with `!-1`. After that, it will fit in 140 chars, with room to spare!
13+
14+Here's the **clean** implementation:
15+
16+{% highlight javascript %}
17+ function fn (a, v, l, h) {
18+ var m;
19+ if (h &lt; l) {
20+ return false;
21+ }
22+
23+ m = Math.floor(l + (h - l) / 2);
24+
25+ if (a[m] &gt; v) {
26+ return fn(a, v, l, m-1);
27+ } else if (a[m] &lt; v) {
28+ return fn(a, v, m+1, h);
29+ } else {
30+ return m;
31+ }
32+ }
33+{% endhighlight %}
_posts/2012-06-25-a-little-chrome-app.markdown+39−0
@@ -0,0 +1,39 @@
1+---
2+layout: post
3+---
4+
5+A little Chrome app
6+-------------------
7+
8+San Jose, Jul 6, 2012
9+
10+I've been using [Backbone.js](http://documentcloud.github.com/backbone/backbone.js) and after a few hours of reading the source in the browser my eyes demanded some syntax highlight. I assumed someone would've done this by now, but I could only find apps that provide much more than a nicer **reading** environment (I'm not looking to edit code on the browser). *Great!*, I tough to myself, *I get to roll my own*! Because I read mostly javascript source code, I focused on that, maybe if the need …
11+
12+So to get started I looked around for highlighting libraries, and found a couple of heavyweights and then I saw [hijs.js by cloudhead](https://github.com/cloudhead/hijs) and I grabbed it!
13+
14+After having a good grasp on what happens inside Hijs I was happy to see that it fits the bill perfectly because it will invoque itself when loaded. At that point all I needed was to actually create the app.
15+
16+I googled for some tutorials and ended up in the [official docs](http://code.google.com/chrome/extensions/overview.html) where I found everything I needed. It wasn't much, all I was missing was a manifest file.
17+
18+And... here it is:
19+
20+ {
21+ "name": "Hijs",
22+ "version": "0.0.1",
23+ "description": "Raw javascript file highlighter.",
24+ "permissions" : [
25+ "http://*/*.js",
26+ "https://*/*.js"
27+ ],
28+ "content_scripts": [
29+ {
30+ "matches": ["http://*/*.js", "https://*/*.js"],
31+ "js": ["hijs.js"],
32+ "css": ["highlight.css"]
33+ }
34+ ]
35+ }
36+
37+It is very simple, but i'm sure it can get much more complicated. Just read the docs!
38+
39+So if you'd like to try it out before I have it done, head on to the [github repo](https://github.com/xonecas/chrome-hijs)
_posts/2013-02-22-google-webfonts-and-the-flash-of-unstyled-text.markdown+5−0
@@ -2,6 +2,11 @@
22 layout: post
33 ---
44
5+Google webfonts and the flash of unstyled text.
6+-----------------------------------------------
7+
8+Sunnyvale, Feb 22, 2013
9+
510 Ever noticed that if you use [Google Webfonts](//www.google.com/webfonts) you might have noticed your custom font text flashing into the custom font from the basic browser supported font. This is because the font takes sometime to download, and the document is usually ready before, so your text is visible. There some extreme fixes, like hiding the whole page while it load, and then showing it all in one move. I chose to do something lighter, because I like seeing the site coming to life, and for …
611
712 #### The Javascript
_posts/2013-02-24-ups-and-downs.markdown+2−2
@@ -3,9 +3,9 @@ layout: post
33 ---
44
55 Ups and downs
6-=============
6+-------------
77
8-24, Fed 2013. Palo Alto.
8+Palo Alto, Feb 24, 2013
99
1010 I don't like camelCase. I don't think it helps making code more readable. With this said, I mostly work with Javascript. I know... It's like hell on earth since JS good practices usually ask for camelCase. I would very much rather user '_' for separation, like those lucky python folks.
1111 I follow the good practices when coding for others, public apis where camelcase is expected. But everywhere else I use _ as a separator. This is my dirty secret. And so far I'm ok with this, even if at times, from project to project I roll back on this decision. At [blyve](//blyve.com) underscores where ok and I follow the basic rule I stated above. Altough at [edshelf](//edshelf.com) I rolled back. I'm using camelCase *agains't my will* because I enforced it on myself. I did this because I'm th …
css/bootstrap.dark.min.css+0−0
css/bootstrap.light.min.css+9−0
@@ -0,0 +1,9 @@
1+@import url('//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700');/*!
2+ * Bootstrap v2.3.0
3+ *
4+ * Copyright 2012 Twitter, Inc
5+ * Licensed under the Apache License v2.0
6+ * http://www.apache.org/licenses/LICENSE-2.0
7+ *
8+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
9+ */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:31px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zo …
css/styles.css+11−0
@@ -4,3 +4,14 @@ h1 {
44 font-family: 'Quantico', sans-serif;
55 font-weight: 700;
66 }
7+.brand {
8+ visibility: hidden;
9+ font-family: 'Quantico', sans-serif;
10+ font-weight: 400;
11+}
12+/* bootstrap affix */
13+.affix, .affix-bottom {
14+ top: 0;
15+ left: 0;
16+ width: 100%;
17+}
index.html+4−1
@@ -4,7 +4,7 @@ layout: default
44
55 <div class="row-fluid">
66 <div class="span2">
7- <h3>Recent posts</h3>
7+ <h3>Recent</h3>
88 <ul class="nav nav-pills nav-stacked">
99 {% for post in site.posts %}
1010 <li>
@@ -15,6 +15,9 @@ layout: default
1515 </li>
1616 {% endfor %}
1717 </ul>
18+
19+ {% include buttons.html %}
20+
1821 </div>
1922 <div class="span10">
2023 <div class="media">
js/script.js+39−1
@@ -4,7 +4,7 @@
44 'use strict';
55 // google web font, no flash of unstyled text
66 window.WebFontConfig = {
7- google: { families: ['Quantico:700,700italic:latin'] },
7+ google: { families: ['Quantico:400,400italic,700,700italic:latin'] },
88 active: function () {
99 // font is ready, assume jquery
1010 $(function () {
@@ -23,4 +23,42 @@
2323 s = document.getElementsByTagName('script')[0];
2424 s.parentNode.insertBefore(wf, s);
2525 }());
26+
27+ function setNavActive() {
28+ var items = $('.navbar .nav li'),
29+ page = location.pathname.match(/\/[a-zA-Z0-9\.\-]+$/);
30+ page = page ? page[0] : page;
31+ if (page === '/work.html') {
32+ items.last().addClass('active');
33+ } else {
34+ items.first().addClass('active');
35+ }
36+ }
37+
38+ function loadStyle(url, fn) {
39+ var style = document.createElement('style'),
40+ fi;
41+ style.textContent = '@import "' + url + '"';
42+ fi = setInterval(function () {
43+ try {
44+ style.sheet.cssRules; // <--- MAGIC: only populated when file is loaded
45+ fn();
46+ clearInterval(fi);
47+ } catch (e) {}
48+ }, 10);
49+
50+ $('head').prepend(style);
51+ }
52+
53+ $(function () {
54+ var body = $('body'),
55+ nav = $('.navbar'),
56+ now = new Date().getHours(),
57+ color = now > 6 && now < 18 ? 'light' : 'dark';
58+ loadStyle('/css/bootstrap.' + color + '.min.css', function () {
59+ body.show();
60+ nav.affix({offset: 221});
61+ setNavActive();
62+ });
63+ });
2664 }());
work.html+73−48
@@ -2,54 +2,79 @@
22 layout: default
33 ---
44
5-<h2>Work history</h2>
6-<div class="media">
7- <a class="pull-left" href='//edshelf.com'>
8- <img class="media-object" src="/img/edshelf.png" width="300">
9- </a>
10- <div class="media-body">
11- <h3 class="media-heading">
12- edshelf
13- <small class="pull-right">
14- <span class="label label-info">Current employer</span>
15- </small>
16- </h3>
17- <p class="lead">
18- Reviews & recommendations of tools for education
19- </p>
20- {% capture edshelf %}{% include edshelf.markdown %}{% endcapture %}
21- {{ edshelf | markdownify }}
22- </div>
23-</div>
24-<hr>
25-<div class="media">
26- <a class="pull-left" href='//blyve.com'>
27- <img class="media-object" src="/img/blyve.png" width="300">
28- </a>
29- <div class="media-body">
30- <h3 class="media-heading">
31- Blyve
32- </h3>
33- <p class="lead">
34- Blyve is a real-time interactive marketing platform for live events that leverages your existing social strategies to help increase customer engagement with your brand.
35- </p>
36- {% capture blyve %}{% include blyve.markdown %}{% endcapture %}
37- {{ blyve | markdownify }}
38- </div>
5+<div class="alert alert-info alert-block text-center">
6+ This page is not finished
397 </div>
40-<hr>
41-<div class="media">
42- <a class="pull-left" href='//wayback.archive.org/web/20120615165225/http://gsnap.com/'>
43- <img class="media-object" src="/img/gsnap.png" width="300">
44- </a>
45- <div class="media-body">
46- <h3 class="media-heading">
47- G-Snap!
48- </h3>
49- <p class="lead">
50- An live platform for events.
51- </p>
52- {% capture gsnap %}{% include gsnap.markdown %}{% endcapture %}
53- {{ gsnap | markdownify }}
8+
9+<div class="row-fluid">
10+ <div class="span12">
11+ <h2>Work history</h2>
12+ <div class="media">
13+ <a class="pull-left" href='//edshelf.com'>
14+ <img class="media-object" src="/img/edshelf.png" width="300">
15+ </a>
16+ <div class="media-body">
17+ <h3 class="media-heading">
18+ edshelf
19+ <small class="pull-right">
20+ <span class="label label-info">Current employer</span>
21+ </small>
22+ </h3>
23+ <p class="lead">
24+ Reviews & recommendations of tools for education
25+ </p>
26+ {% capture edshelf %}{% include edshelf.markdown %}{% endcapture %}
27+ {{ edshelf | markdownify }}
28+ </div>
29+ </div>
30+ <hr>
31+ <div class="media">
32+ <a class="pull-left" href='//blyve.com'>
33+ <img class="media-object" src="//dummyimage.com/800x600/292929/e3e3e3&text=Top Secret" width="300">
34+ </a>
35+ <div class="media-body">
36+ <h3 class="media-heading">
37+ Undisclosed
38+ <small class="pull-right">
39+ <span class="label label-muted">Contract</span>
40+ </small>
41+ </h3>
42+ <p class="lead">
43+ A new and upcoming service!
44+ </p>
45+ </div>
46+ </div>
47+ <hr>
48+ <div class="media">
49+ <a class="pull-left" href='//blyve.com'>
50+ <img class="media-object" src="/img/blyve.png" width="300">
51+ </a>
52+ <div class="media-body">
53+ <h3 class="media-heading">
54+ Blyve
55+ </h3>
56+ <p class="lead">
57+ Blyve is a real-time interactive marketing platform for live events that leverages your existing social strategies to help increase customer engagement with your brand.
58+ </p>
59+ {% capture blyve %}{% include blyve.markdown %}{% endcapture %}
60+ {{ blyve | markdownify }}
61+ </div>
62+ </div>
63+ <hr>
64+ <div class="media">
65+ <a class="pull-left" href='//wayback.archive.org/web/20120615165225/http://gsnap.com/'>
66+ <img class="media-object" src="/img/gsnap.png" width="300">
67+ </a>
68+ <div class="media-body">
69+ <h3 class="media-heading">
70+ G-Snap!
71+ </h3>
72+ <p class="lead">
73+ An live platform for events.
74+ </p>
75+ {% capture gsnap %}{% include gsnap.markdown %}{% endcapture %}
76+ {{ gsnap | markdownify }}
77+ </div>
78+ </div>
5479 </div>
5580 </div>