Skip to content

Instantly share code, notes, and snippets.

View rarous's full-sized avatar
💭
I may be slow to respond.

Aleš Roubíček rarous

💭
I may be slow to respond.
View GitHub Profile
/* https://go.tacodewolff.nl/minify */
enScroll=!1;const lStor=localStorage,sStor=sessionStorage,doc=document,docEl=document.documentElement,docBody=document.body,docLoc=document.location,w=window,s=screen,nav=navigator||{};function a(){const k="G-XXXXXXXXXX",t=()=>Math.floor(Math.random()*1e9)+1,n=()=>Math.floor(Date.now()/1e3),y=()=>(sStor._p||(sStor._p=t()),sStor._p),v=()=>t()+"."+n(),p=()=>(lStor.cid_v4||(lStor.cid_v4=v()),lStor.cid_v4),m=lStor.getItem("cid_v4"),u=()=>m?void 0:enScroll==!0?void 0:"1",l=()=>(sStor.sid||(sStor.sid=n()),sStor.sid),d=()=>{if(!sStor._ss)return sStor._ss="1",sStor._ss;if(sStor.getItem("_ss")=="1")return void 0},r="1",h=()=>{if(sStor.sct)if(enScroll==!0)return sStor.sct;else x=+sStor.getItem("sct")+ +r,sStor.sct=x;else sStor.sct=r;return sStor.sct},e=docLoc.search,f=new URLSearchParams(e),a=["q","s","search","query","keyword"],g=a.some(t=>e.includes("&"+t+"=")||e.includes("?"+t+"=")),i=()=>g==!0?"view_search_results":enScroll==!0?"scroll":"page_view",b=()=>enScroll==!0?"90":void
@rarous
rarous / K2.xml
Last active June 15, 2022 14:36 — forked from monk-topmonks/K2.xml
Serato DJ MIDI mapping for 4 decks (3124) with two K2s
<midi app=" 2.5.12.690">
<control channel="14" event_type="Note On" control="20">
<userio event="click">
<play deck_set="Default" deck_id="1" slot_id="0">
<translation action_on="press" behaviour="toggle"/>
</play>
</userio>
<userio event="output">
<play deck_set="Default" deck_id="1" slot_id="0">
<translation action_on="any">
@rarous
rarous / gol.clj
Last active August 29, 2015 14:14 — forked from kolman/gol.clj
(ns joyful-game.game-of-life)
(defn neighs [[x y]]
(for [dx [-1 0 1]
dy [-1 0 1]
:when (not (= 0 dy dx))]
[(+ x dx) (+ y dy)]))
(defn should-be-alive [nc is-alive]
(or (= nc 3)
package cz.tejnora.pokusy;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
private Map<Integer, ? extends Address> getAddressIndex(Optional<SubjectData> currentSubjectData) {
return currentSubjectData.
map(s -> s.getAddresses().stream().
filter(a -> a.getEsoId() != null).
collect(toMap(Address::getEsoId, t -> t))).
orElse(emptyMap());
}
SelectableItem matchingItem = getItems().stream().
filter(x -> x.getTitle().equals(title)).
findFirst().
orElseGet(() -> SelectableItem.EMPTY);
<div ng-app="videoApp" ng-controller="VideoController">
<table>
<thead>
<th>Title</th>
<th>Length</th>
<th></th>
</thead>
<tbody>
<tr data-id="{{video.Id}}" ng-repeat="video in videos">
public interface IStorage
{
Uri Save(Stream data, string name);
Task<Stream> LoadAsync(Uri dataUri);
}
Dependency Injection a Inversion of Control
https://twitter.com/geekovo/status/290061513300000768
http://rarous.net/weblog/431-dip-ioc-a-di-dil-prvni.aspx
http://rarous.net/weblog/432-dip-ioc-a-di-dil-druhy.aspx
http://rarous.net/weblog/433-dip-ioc-a-di-dil-treti.aspx
$path = "~\AppData\Roaming\ncrunch2012\user.dat"
ri -Force $path