Skip to content

Instantly share code, notes, and snippets.

View OndrejSlamecka's full-sized avatar

Ondřej Slámečka OndrejSlamecka

View GitHub Profile
@OndrejSlamecka
OndrejSlamecka / contains.cpp
Created July 12, 2014 10:26
C++ contains (not tested)
template <template <class> class C, typename T>
bool contains(C<T> container, T item) {
return std::find(container.begin(), container.end(), item) != container.end();
}
@OndrejSlamecka
OndrejSlamecka / yt.js
Last active August 29, 2015 14:07
YellowText fork working with browserify and taking style definition from #yt-default-style (or id specified in textarea's data-styleelementid)
var jQuery = require('jquery');
/*
* Yellow Text - v0.5.0
* Yellow Text is a beautiful text editor which makes creating content fun again. It ships with a beautiful theme and really clever shortkeys.
* https://github.com/stefanvermaas/yellow-text
*
* Made by Stefan Vermaas
* Under BEERWARE License
*/

Keybase proof

I hereby claim:

  • I am ondrejslamecka on github.
  • I am ondrejslamecka (https://keybase.io/ondrejslamecka) on keybase.
  • I have a public key whose fingerprint is 5172 FB9C FCC2 4483 6C42 AB0D B681 321E 9F57 69D1

To claim this, I am signing this object:

@OndrejSlamecka
OndrejSlamecka / springs.jl
Created October 23, 2021 14:58
Animation of connected springs
using Luxor
using Colors
const height = 80
const lw = height / 10
mutable struct Spring
k::Float64 # spring constant
equilibrium_length::Float64
current_length::Float64
julia> using BenchmarkTools
julia> using Dictionaries
julia> function f(d)
for _ = 1:1000
set!(d, 1, 1)
unset!(d, 1)
end
end