This file contains hidden or 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
| require 'arbre' | |
| require 'benchmark' | |
| def generate_html | |
| context = Arbre::Context.new do | |
| 100000.times do |i| | |
| div class: 'article' do | |
| div "Article #{i}", class: 'article__title' | |
| div "Awesome content", class: 'article__content' | |
| end |
This file contains hidden or 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
| class Redis | |
| class Client | |
| class Connector | |
| class Sentinel | |
| def sentinel_detect | |
| @sentinels.each do |sentinel| | |
| client = Client.new(@options.merge({ | |
| :host => sentinel[:host], | |
| :port => sentinel[:port], | |
| :password => sentinel[:password], # patch! |
This file contains hidden or 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
| .git | |
| .gitignore | |
| Dockerfile | |
| log | |
| tmp | |
| public/system |
This file contains hidden or 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
| #include "GridRenderer.h" | |
| #include <Magnum/SceneGraph/Camera.h> | |
| #include <Magnum/DebugTools/ResourceManager.h> | |
| using namespace Magnum; | |
| Color3 getLineColor(Float i, const Color3 &baseColor, const Color3 &axesColor, const Color3 &subColor) { | |
| if (i == 0) { | |
| return axesColor; |
This file contains hidden or 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
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "sync/atomic" | |
| "time" |
This file contains hidden or 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
| function calculateInterceptShotPosition(pShooter, pTarget0, vTarget, sProjectile) | |
| local R = pTarget0 - pShooter | |
| local a = vTarget.x^2 + vTarget.y^2 - sProjectile^2 | |
| local b = 2 * (R.x * vTarget.x + R.y * vTarget.y) | |
| local c = R.x^2 + R.y^2 | |
| if R:len2() < 1 then | |
| return nil | |
| end |
This file contains hidden or 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
| #!/bin/bash | |
| read -r -d '' CHECK_QUERY <<-EOM | |
| create extension if not exists plpgsql_check; | |
| SELECT | |
| (pcf).functionid::regprocedure, (pcf).lineno, (pcf).statement, | |
| (pcf).sqlstate, (pcf).message, (pcf).detail, (pcf).hint, (pcf).level, | |
| (pcf)."position", (pcf).query, (pcf).context |
This file contains hidden or 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
| with recursive r as ( | |
| select id, parent_id | |
| from products | |
| where id = 100 | |
| union | |
| select p.id, p.parent_id | |
| from products p | |
| join r on p.id = r.parent_id | |
| ) | |
| select id from r where parent_id is null; |
This file contains hidden or 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
| -- Deploy [% project %]:[% change %] to [% engine %] | |
| [% FOREACH item IN requires -%] | |
| -- requires: [% item %] | |
| [% END -%] | |
| [% FOREACH item IN conflicts -%] | |
| -- conflicts: [% item %] | |
| [% END -%] | |
| BEGIN; |