-
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
visual upgrade with syntax higlighting and soopr share integration
- Loading branch information
Showing
11 changed files
with
259 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<p class="text-bold text-upcase"> | ||
{% if page.date %} | ||
<span class="post-date">{{ page.date | date: "%B %Y"}}</span> | ||
{% endif %} | ||
{% if site.theme_config.show_soopr %} | ||
<span class="share">Share </span> | ||
<span class="soopr-btn soopr-btn-sm" | ||
data-twitter="abhinav" | ||
data-facebook="abhinavs" | ||
data-text="{{ page.title }}" | ||
data-url="{{ site.url }}/{{ page.url }}"> | ||
</span> | ||
{% endif %} | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
--- | ||
layout: post | ||
--- | ||
|
||
# Language Test | ||
|
||
## Python | ||
```python | ||
import microrequests | ||
|
||
mr = microrequests.init() | ||
# mr is requests' session object and you can use it in similar manner | ||
res = mr.get("http://httpbin.org/get") | ||
print(res.text) | ||
``` | ||
|
||
## Ruby | ||
```ruby | ||
require 'gmail' | ||
require 'time' | ||
require 'yaml' | ||
require 'erb' | ||
|
||
if ARGV.length != 2 | ||
puts "Syntax: #{__FILE__} gmail-username gmail-password" | ||
exit | ||
end | ||
|
||
config = YAML.load_file("#{File.dirname(__FILE__)}/config.yaml") | ||
body = ERB.new(config['body']) | ||
|
||
gmail = Gmail.connect(ARGV[0], ARGV[1]) | ||
|
||
# variable 'name' is important given it is used in body as well | ||
for name, email_id in config['to'] do | ||
puts "sending to #{email_id}" | ||
email = gmail.compose do | ||
to email_id | ||
from config['from'] | ||
subject config['subject'] | ||
body body.result(binding) | ||
end | ||
email.deliver! | ||
end | ||
|
||
gmail.logout | ||
``` | ||
|
||
## Javascript | ||
```javascript | ||
const path = require('path'); | ||
const { merge } = require('webpack-merge'); | ||
const common = require('./webpack.common.js'); | ||
|
||
module.exports = merge(common, { | ||
mode: 'development', | ||
devtool: 'inline-source-map', | ||
devServer: { | ||
writeToDisk: true, | ||
contentBase: path.join(__dirname, 'dist'), | ||
publicPath: path.join(__dirname, 'dist'), | ||
compress: true, | ||
port: 8000, | ||
}, | ||
}); | ||
``` | ||
|
||
## Elixir | ||
```elixir | ||
defmodule MyAppWeb.BearerAuth do | ||
|
||
import Plug.Conn | ||
alias MyApp.Account | ||
|
||
def init(options) do | ||
options | ||
end | ||
|
||
def call(conn, _options) do | ||
case get_bearer_auth_token(conn) do | ||
nil -> | ||
conn |> unauthorized() | ||
:error -> | ||
conn |> unauthorized() | ||
auth_token -> | ||
account = | ||
Account.get_from_token(auth_token) | ||
if account do | ||
assign(conn, :current_account, account) | ||
else | ||
conn |> unauthorized() | ||
end | ||
end | ||
end | ||
|
||
defp get_bearer_auth_token(conn) do | ||
with ["Bearer " <> auth_token] <- get_req_header(conn, "authorization") do | ||
auth_token | ||
else | ||
_ -> :error | ||
end | ||
end | ||
|
||
defp unauthorized(conn) do | ||
conn | ||
|> resp(401, "Unauthorized") | ||
|> halt() | ||
end | ||
end | ||
|
||
``` | ||
|
||
## CSS | ||
```css | ||
.highlight, pre code, blockquote { | ||
border-radius: 0.5em; | ||
} | ||
blockquote { | ||
background-color: var(--bg-secondary); | ||
border: 1px var(--border) solid; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
.highlight .hll { background-color: #515151 } | ||
/*.highlight { background: #2d2d2d; color: #f2f0ec }*/ | ||
.highlight { background: #1A1F35; color: #f2f0ec } | ||
.highlight .c { color: #747369 } /* Comment */ | ||
.highlight .err { color: #f2777a } /* Error */ | ||
.highlight .k { color: #cc99cc } /* Keyword */ | ||
.highlight .l { color: #f99157 } /* Literal */ | ||
.highlight .n { color: #f2f0ec } /* Name */ | ||
.highlight .o { color: #66cccc } /* Operator */ | ||
.highlight .p { color: #f2f0ec } /* Punctuation */ | ||
.highlight .ch { color: #747369 } /* Comment.Hashbang */ | ||
.highlight .cm { color: #747369 } /* Comment.Multiline */ | ||
.highlight .cp { color: #747369 } /* Comment.Preproc */ | ||
.highlight .cpf { color: #747369 } /* Comment.PreprocFile */ | ||
.highlight .c1 { color: #747369 } /* Comment.Single */ | ||
.highlight .cs { color: #747369 } /* Comment.Special */ | ||
.highlight .gd { color: #f2777a } /* Generic.Deleted */ | ||
.highlight .ge { font-style: italic } /* Generic.Emph */ | ||
.highlight .gh { color: #f2f0ec; font-weight: bold } /* Generic.Heading */ | ||
.highlight .gi { color: #99cc99 } /* Generic.Inserted */ | ||
.highlight .gp { color: #747369; font-weight: bold } /* Generic.Prompt */ | ||
.highlight .gs { font-weight: bold } /* Generic.Strong */ | ||
.highlight .gu { color: #66cccc; font-weight: bold } /* Generic.Subheading */ | ||
.highlight .kc { color: #cc99cc } /* Keyword.Constant */ | ||
.highlight .kd { color: #cc99cc } /* Keyword.Declaration */ | ||
.highlight .kn { color: #66cccc } /* Keyword.Namespace */ | ||
.highlight .kp { color: #cc99cc } /* Keyword.Pseudo */ | ||
.highlight .kr { color: #cc99cc } /* Keyword.Reserved */ | ||
.highlight .kt { color: #ffcc66 } /* Keyword.Type */ | ||
.highlight .ld { color: #99cc99 } /* Literal.Date */ | ||
.highlight .m { color: #f99157 } /* Literal.Number */ | ||
.highlight .s { color: #99cc99 } /* Literal.String */ | ||
.highlight .na { color: #6699cc } /* Name.Attribute */ | ||
.highlight .nb { color: #f2f0ec } /* Name.Builtin */ | ||
.highlight .nc { color: #ffcc66 } /* Name.Class */ | ||
.highlight .no { color: #f2777a } /* Name.Constant */ | ||
.highlight .nd { color: #66cccc } /* Name.Decorator */ | ||
.highlight .ni { color: #f2f0ec } /* Name.Entity */ | ||
.highlight .ne { color: #f2777a } /* Name.Exception */ | ||
.highlight .nf { color: #6699cc } /* Name.Function */ | ||
.highlight .nl { color: #f2f0ec } /* Name.Label */ | ||
.highlight .nn { color: #ffcc66 } /* Name.Namespace */ | ||
.highlight .nx { color: #6699cc } /* Name.Other */ | ||
.highlight .py { color: #f2f0ec } /* Name.Property */ | ||
.highlight .nt { color: #66cccc } /* Name.Tag */ | ||
.highlight .nv { color: #f2777a } /* Name.Variable */ | ||
.highlight .ow { color: #66cccc } /* Operator.Word */ | ||
.highlight .w { color: #f2f0ec } /* Text.Whitespace */ | ||
.highlight .mb { color: #f99157 } /* Literal.Number.Bin */ | ||
.highlight .mf { color: #f99157 } /* Literal.Number.Float */ | ||
.highlight .mh { color: #f99157 } /* Literal.Number.Hex */ | ||
.highlight .mi { color: #f99157 } /* Literal.Number.Integer */ | ||
.highlight .mo { color: #f99157 } /* Literal.Number.Oct */ | ||
.highlight .sa { color: #99cc99 } /* Literal.String.Affix */ | ||
.highlight .sb { color: #99cc99 } /* Literal.String.Backtick */ | ||
.highlight .sc { color: #f2f0ec } /* Literal.String.Char */ | ||
.highlight .dl { color: #99cc99 } /* Literal.String.Delimiter */ | ||
.highlight .sd { color: #747369 } /* Literal.String.Doc */ | ||
.highlight .s2 { color: #99cc99 } /* Literal.String.Double */ | ||
.highlight .se { color: #f99157 } /* Literal.String.Escape */ | ||
.highlight .sh { color: #99cc99 } /* Literal.String.Heredoc */ | ||
.highlight .si { color: #f99157 } /* Literal.String.Interpol */ | ||
.highlight .sx { color: #99cc99 } /* Literal.String.Other */ | ||
.highlight .sr { color: #99cc99 } /* Literal.String.Regex */ | ||
.highlight .s1 { color: #99cc99 } /* Literal.String.Single */ | ||
.highlight .ss { color: #99cc99 } /* Literal.String.Symbol */ | ||
.highlight .bp { color: #f2f0ec } /* Name.Builtin.Pseudo */ | ||
.highlight .fm { color: #6699cc } /* Name.Function.Magic */ | ||
.highlight .vc { color: #f2777a } /* Name.Variable.Class */ | ||
.highlight .vg { color: #f2777a } /* Name.Variable.Global */ | ||
.highlight .vi { color: #f2777a } /* Name.Variable.Instance */ | ||
.highlight .vm { color: #f2777a } /* Name.Variable.Magic */ | ||
.highlight .il { color: #f99157 } /* Literal.Number.Integer.Long */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
@import "moonwalk"; | ||
@import "list"; | ||
@import "syntax"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters