Skip to content

Instantly share code, notes, and snippets.

View pickparams.c
#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 Apr 14, 2017
Parse Mansion Areas
View areas.txt
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
View rails-sti-test.rb
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.
View block-testing.rb
class A
def call
foo do
yield if block_given?
puts "a"
end
end
def foo
yield
View dostuff.js
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() {
View gist:0c5ff28b32a9bfd8a9af
# 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.
View application.html.erb
# application.html.erb
<%= stylesheet_link_tag "vendor", :media => "all" %>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "vendor" %>
<%= javascript_include_tag "application" %>
View more-recent-posts.js
$(function() {
new Tumblr.RecentPosts($("#recent-posts"), 20).render()
})
@jarmo
jarmo / tumblr-recent-posts.js
Created Nov 11, 2012
Tumblr Recent Posts Widget
View tumblr-recent-posts.js
/*
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 Oct 7, 2012 — forked from mattsears/README.md
Todo.rb: A simple command-line TODO manager written in Ruby
View README.md

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: