mirror of
https://github.com/aljazceru/cryptoanarchywiki.github.io.git
synced 2025-12-17 05:04:21 +01:00
187 lines
22 KiB
XML
187 lines
22 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||
<channel>
|
||
<title></title>
|
||
<description></description>
|
||
<link>https://agusmakmun.github.io/</link>
|
||
<atom:link href="https://agusmakmun.github.io/sitemap.xml" rel="self" type="application/rss+xml"/>
|
||
<pubDate>Tue, 19 Apr 2016 13:41:48 +0700</pubDate>
|
||
<lastBuildDate>Tue, 19 Apr 2016 13:41:48 +0700</lastBuildDate>
|
||
<generator>Jekyll v3.0.3</generator>
|
||
|
||
<item>
|
||
<title>Email BackEnd with SMTP Gmail</title>
|
||
<description><p>Add this configurations in your <code class="highlighter-rouge">settings.py</code></p>
|
||
|
||
<p>This configurations is if you work with <code class="highlighter-rouge">smtp.gmail.com</code>, other smtp is similiar with configurations.</p>
|
||
|
||
<ul>
|
||
<li>Unlock Captha: <a href="https://accounts.google.com/DisplayUnlockCaptcha">https://accounts.google.com/DisplayUnlockCaptcha</a></li>
|
||
<li>Change to active: <a href="https://www.google.com/settings/security/lesssecureapps">https://www.google.com/settings/security/lesssecureapps</a></li>
|
||
</ul>
|
||
|
||
<div class="highlighter-rouge"><pre class="highlight"><code>EMAIL_HOST = 'smtp.gmail.com'
|
||
EMAIL_PORT = 587
|
||
EMAIL_HOST_USER = 'your_gmail@gmail.com'
|
||
EMAIL_HOST_PASSWORD = 'your_password'
|
||
EMAIL_USE_TLS = True
|
||
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
|
||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||
</code></pre>
|
||
</div>
|
||
</description>
|
||
<pubDate>Tue, 19 Apr 2016 02:28:15 +0700</pubDate>
|
||
<link>https://agusmakmun.github.io/django/2016/04/19/email-backend-with-smtp-gmail.html</link>
|
||
<guid isPermaLink="true">https://agusmakmun.github.io/django/2016/04/19/email-backend-with-smtp-gmail.html</guid>
|
||
|
||
|
||
<category>django</category>
|
||
|
||
</item>
|
||
|
||
<item>
|
||
<title>Welcome to Simply Grey</title>
|
||
<description><p>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.</p>
|
||
|
||
<h2 id="why-use-simply-grey">Why use Simply Grey?</h2>
|
||
<p>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.</p>
|
||
|
||
<ul>
|
||
<li><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.</li>
|
||
<li><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 <code class="highlighter-rouge">urls</code> part of it.</li>
|
||
<li><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.</li>
|
||
</ul>
|
||
|
||
<h2 id="jekyll">Jekyll</h2>
|
||
<p>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.</p>
|
||
|
||
<h3 id="code-snippets">Code Snippets</h3>
|
||
<p>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.</p>
|
||
|
||
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="c1">#!/usr/bin/env ruby</span>
|
||
|
||
<span class="nb">require</span> <span class="s1">'json'</span>
|
||
<span class="nb">require</span> <span class="s1">'net/http'</span>
|
||
<span class="nb">require</span> <span class="s1">'libnotify'</span>
|
||
|
||
<span class="k">def</span> <span class="nf">parsejson</span>
|
||
<span class="n">file</span> <span class="o">=</span> <span class="s2">"http://api.openweathermap.org/data/2.5/find?q=London&amp;mode=json"</span>
|
||
<span class="n">response</span> <span class="o">=</span> <span class="no">Net</span><span class="o">::</span><span class="no">HTTP</span><span class="p">.</span><span class="nf">get_response</span><span class="p">(</span><span class="no">URI</span><span class="p">.</span><span class="nf">parse</span><span class="p">(</span><span class="n">file</span><span class="p">))</span>
|
||
<span class="n">weatherjson</span> <span class="o">=</span> <span class="n">response</span><span class="p">.</span><span class="nf">body</span>
|
||
<span class="n">actual</span> <span class="o">=</span> <span class="no">JSON</span><span class="p">.</span><span class="nf">parse</span><span class="p">(</span><span class="n">weatherjson</span><span class="p">)</span>
|
||
|
||
<span class="c1"># check for errors</span>
|
||
<span class="k">if</span> <span class="n">actual</span><span class="p">.</span><span class="nf">has_key?</span> <span class="s1">'Error'</span>
|
||
<span class="k">raise</span> <span class="s2">"error with the url"</span>
|
||
<span class="k">end</span>
|
||
|
||
<span class="n">results</span> <span class="o">=</span> <span class="p">[]</span>
|
||
|
||
<span class="n">actual</span><span class="p">[</span><span class="s2">"list"</span><span class="p">].</span><span class="nf">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">listitem</span><span class="o">|</span>
|
||
<span class="n">weather</span> <span class="o">=</span> <span class="n">listitem</span><span class="p">[</span><span class="s2">"weather"</span><span class="p">]</span>
|
||
<span class="n">weather</span><span class="p">.</span><span class="nf">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">weath</span><span class="o">|</span>
|
||
<span class="n">results</span><span class="p">.</span><span class="nf">push</span><span class="p">(</span><span class="n">weath</span><span class="p">[</span><span class="s2">"description"</span><span class="p">])</span>
|
||
<span class="k">end</span>
|
||
<span class="n">main</span> <span class="o">=</span> <span class="n">listitem</span><span class="p">[</span><span class="s2">"main"</span><span class="p">]</span>
|
||
<span class="n">temp</span> <span class="o">=</span> <span class="n">main</span><span class="p">[</span><span class="s2">"temp"</span><span class="p">]</span> <span class="o">-</span> <span class="mi">273</span><span class="o">.</span><span class="mi">15</span>
|
||
<span class="n">results</span><span class="p">.</span><span class="nf">push</span> <span class="p">(</span><span class="s2">"%.2f"</span> <span class="o">%</span> <span class="n">temp</span><span class="p">)</span>
|
||
<span class="k">end</span>
|
||
|
||
<span class="k">return</span> <span class="n">results</span>
|
||
<span class="k">end</span>
|
||
|
||
<span class="k">def</span> <span class="nf">notify</span><span class="p">(</span><span class="n">summary</span><span class="p">)</span>
|
||
<span class="no">Libnotify</span><span class="p">.</span><span class="nf">show</span><span class="p">(</span><span class="ss">:body</span> <span class="o">=&gt;</span> <span class="s2">"Current temperature is: </span><span class="si">#{</span><span class="n">summary</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="si">}</span><span class="s2"> degrees celsius.</span><span class="se">\n</span><span class="s2">Current description of conditions: </span><span class="si">#{</span><span class="n">summary</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> <span class="ss">:summary</span> <span class="o">=&gt;</span> <span class="s2">"Weather Update"</span><span class="p">,</span> <span class="ss">:timeout</span> <span class="o">=&gt;</span> <span class="mi">10</span><span class="p">)</span>
|
||
<span class="k">end</span>
|
||
|
||
<span class="n">notify</span><span class="p">(</span><span class="n">parsejson</span><span class="p">())</span></code></pre></figure>
|
||
|
||
<p>Check out the <a href="http://jekyllrb.com">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/mojombo/jekyll">Jekyll’s GitHub repo</a>.</p>
|
||
|
||
</description>
|
||
<pubDate>Mon, 23 Dec 2013 00:18:23 +0700</pubDate>
|
||
<link>https://agusmakmun.github.io/simplygrey/2013/12/23/welcome-to-simply-grey.html</link>
|
||
<guid isPermaLink="true">https://agusmakmun.github.io/simplygrey/2013/12/23/welcome-to-simply-grey.html</guid>
|
||
|
||
|
||
<category>simplygrey</category>
|
||
|
||
</item>
|
||
|
||
<item>
|
||
<title>Parsing JSON with Ruby</title>
|
||
<description><p>Parsing JSON with Ruby is actually extremely easy. All you have to do is have the json gem installed (<code class="highlighter-rouge">gem install json</code>) and call the <code class="highlighter-rouge">JSON.parse</code> 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.</p>
|
||
|
||
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="c1">#!/usr/bin/env ruby</span>
|
||
|
||
<span class="nb">require</span> <span class="s1">'json'</span>
|
||
<span class="nb">require</span> <span class="s1">'net/http'</span>
|
||
<span class="nb">require</span> <span class="s1">'libnotify'</span>
|
||
|
||
<span class="k">def</span> <span class="nf">parsejson</span>
|
||
<span class="n">file</span> <span class="o">=</span> <span class="s2">"http://api.openweathermap.org/data/2.5/find?q=London&amp;mode=json"</span>
|
||
<span class="n">response</span> <span class="o">=</span> <span class="no">Net</span><span class="o">::</span><span class="no">HTTP</span><span class="p">.</span><span class="nf">get_response</span><span class="p">(</span><span class="no">URI</span><span class="p">.</span><span class="nf">parse</span><span class="p">(</span><span class="n">file</span><span class="p">))</span>
|
||
<span class="n">weatherjson</span> <span class="o">=</span> <span class="n">response</span><span class="p">.</span><span class="nf">body</span>
|
||
<span class="n">actual</span> <span class="o">=</span> <span class="no">JSON</span><span class="p">.</span><span class="nf">parse</span><span class="p">(</span><span class="n">weatherjson</span><span class="p">)</span>
|
||
|
||
<span class="c1"># check for errors</span>
|
||
<span class="k">if</span> <span class="n">actual</span><span class="p">.</span><span class="nf">has_key?</span> <span class="s1">'Error'</span>
|
||
<span class="k">raise</span> <span class="s2">"error with the url"</span>
|
||
<span class="k">end</span>
|
||
|
||
<span class="n">results</span> <span class="o">=</span> <span class="p">[]</span>
|
||
|
||
<span class="n">actual</span><span class="p">[</span><span class="s2">"list"</span><span class="p">].</span><span class="nf">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">listitem</span><span class="o">|</span>
|
||
<span class="n">weather</span> <span class="o">=</span> <span class="n">listitem</span><span class="p">[</span><span class="s2">"weather"</span><span class="p">]</span>
|
||
<span class="n">weather</span><span class="p">.</span><span class="nf">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">weath</span><span class="o">|</span>
|
||
<span class="n">results</span><span class="p">.</span><span class="nf">push</span><span class="p">(</span><span class="n">weath</span><span class="p">[</span><span class="s2">"description"</span><span class="p">])</span>
|
||
<span class="k">end</span>
|
||
<span class="n">main</span> <span class="o">=</span> <span class="n">listitem</span><span class="p">[</span><span class="s2">"main"</span><span class="p">]</span>
|
||
<span class="n">temp</span> <span class="o">=</span> <span class="n">main</span><span class="p">[</span><span class="s2">"temp"</span><span class="p">]</span> <span class="o">-</span> <span class="mi">273</span><span class="o">.</span><span class="mi">15</span>
|
||
<span class="n">results</span><span class="p">.</span><span class="nf">push</span> <span class="p">(</span><span class="s2">"%.2f"</span> <span class="o">%</span> <span class="n">temp</span><span class="p">)</span>
|
||
<span class="k">end</span>
|
||
|
||
<span class="k">return</span> <span class="n">results</span>
|
||
<span class="k">end</span></code></pre></figure>
|
||
|
||
</description>
|
||
<pubDate>Mon, 23 Dec 2013 00:18:23 +0700</pubDate>
|
||
<link>https://agusmakmun.github.io/ruby/2013/12/23/ruby-json.html</link>
|
||
<guid isPermaLink="true">https://agusmakmun.github.io/ruby/2013/12/23/ruby-json.html</guid>
|
||
|
||
|
||
<category>ruby</category>
|
||
|
||
</item>
|
||
|
||
<item>
|
||
<title>Welcome to Jekyll!</title>
|
||
<description><p>You’ll find this post in your <code class="highlighter-rouge">_posts</code> directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run <code class="highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>
|
||
|
||
<p>To add new posts, simply add a file in the <code class="highlighter-rouge">_posts</code> directory that follows the convention <code class="highlighter-rouge">YYYY-MM-DD-name-of-post.ext</code> and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.</p>
|
||
|
||
<p>Jekyll also offers powerful support for code snippets:</p>
|
||
|
||
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
|
||
<span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
|
||
<span class="k">end</span>
|
||
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
|
||
<span class="c1">#=&gt; prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>
|
||
|
||
<p>Check out the <a href="http://jekyllrb.com/docs/home">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/jekyll/jekyll">Jekyll’s GitHub repo</a>. If you have questions, you can ask them on <a href="https://talk.jekyllrb.com/">Jekyll Talk</a>.</p>
|
||
|
||
</description>
|
||
<pubDate>Tue, 19 Feb 2013 21:28:15 +0700</pubDate>
|
||
<link>https://agusmakmun.github.io/jekyll/update/2013/02/19/welcome-to-jekyll.html</link>
|
||
<guid isPermaLink="true">https://agusmakmun.github.io/jekyll/update/2013/02/19/welcome-to-jekyll.html</guid>
|
||
|
||
|
||
<category>jekyll</category>
|
||
|
||
<category>update</category>
|
||
|
||
</item>
|
||
|
||
</channel>
|
||
</rss>
|