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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<style> | |
body { | |
font: 10px sans-serif; | |
} | |
svg { |
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
def vim(*args) | |
if self.class == Rush::Dir | |
system "cd #{full_path}; vim +NERDTree" | |
else | |
super | |
end | |
end | |
alias_method :v, :vim |
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
require 'matrix' | |
class TwoSquare | |
attr_accessor :first_square, :second_square | |
ALPHABET = 'йцукенгшщзхъэждлорпавыфячсмитьбю.,- '.split('') | |
def initialize | |
@first_square = build_square | |
@second_square = build_square |
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
# Search of graph. | |
# | |
# Algorightm of graph construction: | |
# Define start state. | |
# Define finish state. | |
# Define valid state. | |
# For each not opened node | |
# open node | |
# end | |
# |
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
TAG_STRING = /(@\w+\W?)+/ | |
EMPTY_STRING = /^\W*$/ | |
def scan_project(dirname, tag) | |
Dir.new(dirname). | |
select { |file| File.extname(file) == '.feature' }. | |
inject('') { |r, f| r << format_file(f, scan_file(f, tag)) } | |
end | |
def format_file(filename, scan_result) |
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
#!/usr/bin/env ruby | |
require 'flickraw' | |
require 'json' | |
CREATE_API_KEY = 'https://secure.flickr.com/services/apps/create/apply' | |
CONFIG_FILE = File.expand_path '~/.config/2flickr.json' | |
def init |
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
#!/usr/bin/env ruby | |
require 'sparql/client' | |
sparql = SPARQL::Client.new("http://dbpedia.org/sparql") | |
query = "prefix dbpprop: <http://dbpedia.org/property/> | |
prefix dbpedia-owl: <http://dbpedia.org/ontology/> | |
select ?name, ?hdi | |
where { | |
?country a dbpedia-owl:Country . |
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
%h2.expandall Expand/Collapse All | |
- @tag.pages.each do |page| | |
%div{ class: 'title', id: "title_#{page.title}" } | |
= page.pretty_title | |
= link_to(" [edit]", controller: 'wiki', action: 'show', | | |
project_id: page.project, id: page.title) | |
%div{ class: 'section', id: page.title } | |
= raw Redmine::WikiFormatting::Textile::Formatter.new(page.text).to_html | |
:javascript |
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
vim.o.background = "light" | |
vim.o.termguicolors = true | |
if vim.g.colors_name then vim.cmd("hi clear") end | |
vim.cmd("syntax reset") | |
vim.g.colors_name = "Boring Tomorrow" | |
-- Default GUI Colours |