Skip to content

Instantly share code, notes, and snippets.

View exlee's full-sized avatar

Alexander Przemysław Kamiński exlee

View GitHub Profile
@exlee
exlee / scratch.tla
Last active May 11, 2023 09:53
TLA Simple Demo (comments in PL)
------------------------------ MODULE scratch ------------------------------
EXTENDS Integers, TLC
\* Zmienne
VARIABLE x,step,increase_by,init
\* Stałe - podane przez użytkownika
CONSTANT steps,y_range
\* Tablica zmiennych - jako ułatwienie, bo każdy
@exlee
exlee / weddings.rs
Last active March 7, 2023 17:37
Rust: Why we don't alias mutable references.
// Person here is shallow on many levels
struct Person { name: String, attractiveness: u8 }
impl Person {
fn glance(&self, someone: &Person) {
let look = match(someone.attractiveness) {
0 ..= 2 => "...uuhh..",
3 ..= 5 => "good. Definitelly good!",
6 ..= 8 => "great!",
9 ..= 10 => "amazing!!",
11 | _ => {
@exlee
exlee / lunch.rb
Last active March 23, 2016 13:07
Ruletka lunchowa / Lunch Roulette
#!env ruby
# -*- coding: utf-8 -*-
ile = ARGV[0].to_i
ile = 1 if ile == 0
opcje = <<EOT
Bar mleczny
Amrit
@exlee
exlee / fizzbuzz.exs
Created March 3, 2016 10:25
FizzBuzz in Elixir
defmodule FizzBuzz do
def print(no) when (rem(no, 15) == 0) do
IO.puts "FizzBuzz"
end
def print(no) when (rem(no, 3) == 0) do
IO.puts "Fizz"
end
@exlee
exlee / application.controller.js
Created September 4, 2015 13:37
Ember Data results into components
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
model: "a"
});
@exlee
exlee / application.controller.js
Last active May 10, 2022 01:19
ember: dynamic language in templates. use LanguageController?
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
switchLanguage: function() {
var t = this.get('translator');
if(t.lang === "t1") {
t.changeLanguage("t2");
} else {
t.changeLanguage("t1");
test_dir1:1000:1000
test_dir2:1001:1001
test_dir3:1002:1002
;Setting the package archives
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
(setq package-enable-at-startup nil)
(package-initialize)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
#include <stdio.h>
#include <wchar.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "hidapi.h"
#define MAX_STR 255
App.QrTransform = DS.Transform.extend({
deserialize: function(serialized) {
return 30;
},
});