This commit is contained in:
agusmakmun
2016-04-18 18:42:56 +07:00
parent d1020e4166
commit 738c89afef
15 changed files with 505 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016 agus makmun
Copyright (c) 2016 Agus Makmun
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.

9
_config.yml Normal file
View File

@@ -0,0 +1,9 @@
name: Agus Makmun
markdown: redcarpet
pygments: true
github: https://github.com/agusmakmun
about: I am an independent developer from the sunny UK. I dabble in Ruby, play in C and I'm an avid systems administrator.
urls:
- text: github
url: https://github.com/agusmakmun
baseurl: '/agusmakmun.github.io'

62
_layouts/default.html Normal file
View File

@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{% if page.title %} {{ page.title }} {% else %} {{ site.name }} {% endif %}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- syntax highlighting CSS -->
<link rel="stylesheet" href="{{ site.baseurl }}/css/syntax.css">
<!-- Bootstrap core CSS -->
<link href="{{ site.baseurl }}/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
</head>
<body>
<div class="container">
<div class="col-sm-3">
<h1>{{ site.name }}</h1>
<img id="about" src="{{ site.baseurl }}/img/logo.jpg" height="75px" width="75px" /><br />
<strong>navigation</strong><br />
<a href="{{ site.baseurl }}/">home</a> <br />
{% for i in site.urls %}
<a class="about" href="{{ i.url }}">{{ i.text }}</a><br />
{% endfor %}
{% if site.about %}
<div id="about">
<strong>about</strong><br />
{{ site.about }}
</div>
{% endif %}
</div>
<div class="col-sm-8 col-offset-1">
{{ content }}
<footer>
&copy; {{ site.name }}
{% if site.github %}
- <a href="{{ site.github }}">{{ site.github }}</a>
{% endif %}
</footer>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>

9
_layouts/post.html Normal file
View File

@@ -0,0 +1,9 @@
---
layout: default
---
<h1>{{ page.title }}</h1>
<span class="time">{{ page.date | date_to_string }}</span>
<div class="content">
<div class="post">{{ content }}</div>
</div>

View File

@@ -0,0 +1,41 @@
---
layout: post
title: "Parsing JSON with Ruby"
date: 2013-12-23 00:18:23
categories: ruby
---
Parsing JSON with Ruby is actually extremely easy. All you have to do is have the json gem installed (`gem install json`) and call the `JSON.parse` method on the JSON data to convert it to ruby hashes. If you look at this small program here, you can see how I have implemented parsing JSON in Ruby.
{% highlight ruby %}
#!/usr/bin/env ruby
require 'json'
require 'net/http'
require 'libnotify'
def parsejson
file = "http://api.openweathermap.org/data/2.5/find?q=London&mode=json"
response = Net::HTTP.get_response(URI.parse(file))
weatherjson = response.body
actual = JSON.parse(weatherjson)
# check for errors
if actual.has_key? 'Error'
raise "error with the url"
end
results = []
actual["list"].each do |listitem|
weather = listitem["weather"]
weather.each do |weath|
results.push(weath["description"])
end
main = listitem["main"]
temp = main["temp"] - 273.15
results.push ("%.2f" % temp)
end
return results
end
{% endhighlight %}

View File

@@ -0,0 +1,64 @@
---
layout: post
title: "Welcome to Simply Grey"
date: 2013-12-23 00:18:23
categories: simplygrey
---
SimplyGrey is a simple, easy to use theme for Jekyll that compromises of mainly grey colours. A lot of people enjoy the simplistic look of grey and also find it easier to read.
## Why use Simply Grey?
There are lots of reasons why I think you should use Simply Grey but I will list the main ones that I believe are more of benefit to you, the user.
+ <em>Easy to use and setup</em> - Jekyll has a huge range of documentation to get you started writing posts and the Simply Grey theme makes your blog look beautiful.
+ <em>Easy configuration</em> - I developed this theme in order to be as customisable as possible. If you want to add more links to the navigation bar, all you have to do is edit the _config.yaml file and the `urls` part of it.
+ <em>You can change it</em> - After being released with the MIT license (like Jekyll itself) you are free to change and basically do anything you want to this theme provided you keep the copyright notice in the files and distribute the license with it.
## Jekyll
Jekyll is a static site generator developed in ruby that generates websites from markdown and many other formats. The benefit of this is that you can have a highly customisable blog where you can generate posts by writing easy markdown code whilst still retaining the small memory imprint that Jekyll has.
### Code Snippets
Code Snippets are one of the main reasons why I love Jekyll and I think you will too. All code snippets become highlighted with great colours when you write the code in markdown. Here is an example of highlighted Ruby code in a weather application that I have made.
{% highlight ruby %}
#!/usr/bin/env ruby
require 'json'
require 'net/http'
require 'libnotify'
def parsejson
file = "http://api.openweathermap.org/data/2.5/find?q=London&mode=json"
response = Net::HTTP.get_response(URI.parse(file))
weatherjson = response.body
actual = JSON.parse(weatherjson)
# check for errors
if actual.has_key? 'Error'
raise "error with the url"
end
results = []
actual["list"].each do |listitem|
weather = listitem["weather"]
weather.each do |weath|
results.push(weath["description"])
end
main = listitem["main"]
temp = main["temp"] - 273.15
results.push ("%.2f" % temp)
end
return results
end
def notify(summary)
Libnotify.show(:body => "Current temperature is: #{summary[1]} degrees celsius.\nCurrent description of conditions: #{summary[0]}", :summary => "Weather Update", :timeout => 10)
end
notify(parsejson())
{% endhighlight %}
Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll's GitHub repo][jekyll-gh].
[jekyll-gh]: https://github.com/mojombo/jekyll
[jekyll]: http://jekyllrb.com

7
css/bootstrap-theme.min.css vendored Executable file

File diff suppressed because one or more lines are too long

7
css/bootstrap.min.css vendored Executable file

File diff suppressed because one or more lines are too long

159
css/main.css Executable file
View File

@@ -0,0 +1,159 @@
/**
* //////////////
* Master styling
* //////////////
*/
body {
color: #424242;
}
@media (min-width: 768px) {
.container {
max-width: 730px;
}
}
/**
* //////////////////////////
* Font and link declarations
* //////////////////////////
*/
span.time {
color: #ADADAD;
margin-bottom: 5px;
font-size: 11px;
}
h1 {
font-weight: normal;
color: #696969;
margin-bottom: 10px;
}
h2 {
font-weight: normal;
margin-bottom: 5px;
color: #666666;
border-bottom: 1px solid #E6E6E6;
}
h3 {
font-weight: normal;
margin-bottom: 5px;
color: #666666;
text-decoration: underline;
}
a, a:link, a:active {
text-decoration: none;
color: #8C8C8C;
}
a:hover {
color: #B3B3B3;
text-decoration: underline;
}
/**
* /////////////////
* Container element
* /////////////////
*/
div#container {
width: 700px;
margin: auto;
}
/**
* //////////////////////////////////
* Right aka content column formatting
* //////////////////////////////////
*/
div.right {
width: 500px;
float: left;
}
div.content {
border-top: 1px solid #E6E6E6;
margin-top: 5px;
padding-top: 5px;
}
div.content pre {
background: #333333;
padding: 5px;
color: #FFF;
overflow-x: auto;
font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;
font-size: 12px;
}
div.content .highlight {
background: #333333;
}
footer {
border-top: 1px solid #E6E6E6;
width: 100%;
height: 10px;
margin-top: 10px;
padding-top: 10px;
color: #C2C2C2;
font-size: 11px;
bottom: 0;
padding-bottom: 10px;
}
footer div#github {
text-align: right;
}
div.right h1 {
margin-bottom: -2px;
}
div.right ul {
list-style: none;
margin-left: 0;
padding: 0;
}
div.right ul li {
margin-top: 5px;
margin-left: 0;
padding: 0;
}
div.right .post ul {
list-style: square;
margin-left: 15px;
}
/**
* ///////////////////////////////////
* Left column aka nav bar formatting
* ///////////////////////////////////
*/
div.col-sm-3 {
margin-top: 100px;
font-size: 11px;
color: #666;
}
div.col-sm-3 strong {
font-size: 16px;
color: #4A4A4A;
font-weight: normal;
}
div.col-sm-3 div#about {
margin-top: 10px;
color: #8C8C8C;
}
div.col-sm-3 img#about {
-webkit-border-radius: 150px;
margin-bottom: 10px;
margin-left: auto;
margin-right: auto;
}

59
css/syntax.css Normal file
View File

@@ -0,0 +1,59 @@
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */

BIN
img/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

12
index.html Normal file
View File

@@ -0,0 +1,12 @@
---
layout: default
---
<div id="home">
<h1>Blog Posts</h1>
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> &raquo; <a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</div>

6
js/bootstrap.min.js vendored Executable file

File diff suppressed because one or more lines are too long

3
readme.md Normal file
View File

@@ -0,0 +1,3 @@
> This project forking from [A simple grey theme for Jekyll](https://github.com/liamsymonds/simplygrey-jekyll)
Our Stack Problems

65
test.html Executable file
View File

@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{% if page.title %} {{ page.title }} {% else %} {{ site.name }} {% endif %}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- syntax highlighting CSS -->
<link rel="stylesheet" href="css/syntax.css">
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="container">
<div class="col-sm-3">
<h1>Simply Grey</h1>
<img id="about" src="img/logo.jpg" height="75px" width="75px" /><br />
<strong>navigation</strong><br />
<a href="{{ site.baseurl }}/">home</a> <br />
<a class="about" href="{{ i.url }}">{{ i.text }}</a><br />
<a class="about" href="{{ i.url }}">{{ i.text }}</a><br />
<div id="about">
<strong>about</strong><br />
about me lalala
</div>
</div>
<div class="col-sm-8 col-offset-1">
<h1>Title</h1>
<span class="time">34 Dec</span>
<div class="content">
<div class="post">This is the main content lalallalalalallalalalalalThis is the main content lalallalalalallalalalalalThis is the main content lalallalalalalalalalThis is the main content lalallalalalallalalalalalThis is the main content lalallalalalallalalalalalThis is the main content lalallalalalallalalalalalThis is the main content lalallalallalallalalalalal</div>
</div>
<footer>
&copy; {{ site.name }}
{% if site.github %}
- <a href="{{ site.github }}">{{ site.github }}</a>
{% endif %}
</footer>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>