Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <inttypes.h>
#include <math.h>
// Function, which calculates N, p and r from opslimit and memslimit copied from
// libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c
int pickparams(unsigned long long opslimit, const size_t memlimit,
uint32_t *const N_log2, uint32_t *const p, uint32_t *const r) {
unsigned long long maxN;
unsigned long long maxrp;
@jarmo
jarmo / areas.txt
Last active April 14, 2017 16:53
Parse Mansion Areas
Aa mõisa park: 10 / 0
Aaspere mõisa park: 35,4 / 1
Aavere mõisa park: 7,3 / 0
Abja mõisa park(kavandatav kaitstav ala): 10,9 / 0
Adavere mõisa park: 6,3 / 0
Ahja mõisa park: 6,8 / 2,1
Alatskivi mõisa park(mitteametlik kavandatav kaitstav ala): 83,9 / 0
Alavere mõisa park: 7 / 0,6
Albu mõisa park: 6,7 / 0,1
Alu mõisa park: 9,2 / 4,3
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
# Activate the gem you are reporting the issue against.
class A
def call
foo do
yield if block_given?
puts "a"
end
end
def foo
yield
@jarmo
jarmo / dostuff.js
Last active November 18, 2020 16:00
var Foo = function() {
this.doStuff = function() {}
}
// kui tahad olla optimaalsem, et oleks ainult üks doStuff funktsioon, siis tuleb protyypida
var Foo = function() {}
Foo.prototype.doStuff = function() {}
// "õige"
var Foo = function() {
# Activate the gem you are reporting the issue against.
gem 'activerecord', '4.2.0'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
# This connection will do for database-independent bug reports.
# application.html.erb
<%= stylesheet_link_tag "vendor", :media => "all" %>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "vendor" %>
<%= javascript_include_tag "application" %>
$(function() {
new Tumblr.RecentPosts($("#recent-posts"), 20).render()
})
@jarmo
jarmo / tumblr-recent-posts.js
Created November 11, 2012 22:48
Tumblr Recent Posts Widget
/*
This widget shows Recent Posts on your Tumblr blog.
Its dependency is jQuery.
Usage:
1) Add html:
<div id="recent-posts"></div>
2) Add code into the <head>:
@jarmo
jarmo / README.md
Created October 7, 2012 10:34 — forked from mattsears/README.md
Todo.rb: A simple command-line TODO manager written in Ruby

Todo.rb

Todo.rb is a simple command-line tool for managing todos. It's minimal, straightforward, and you can use it with your favorite text editor.

Getting Started

Todo.rb doesn't require any third-party gems so you can copy the file anywhere and use it as long as it's executable: