Skip to content

Instantly share code, notes, and snippets.

View ciekawy's full-sized avatar

Szymon Stasik ciekawy

View GitHub Profile
@ciekawy
ciekawy / A. DBRX.md
Created April 19, 2024 15:43
casual LLM Clash - evaluated responses

Client-Side Encryption:

To implement client-side encryption, we will use the Web Crypto API for encryption and decryption operations. We will ensure that the backend never has access to the plaintext data or encryption keys. First, let's create a function to generate a secure encryption key using the Web Crypto API:

async function generateEncryptionKey(): Promise<CryptoKey> {
  // Generate a new AES-GCM key
  const key = await crypto.subtle.generateKey(
    {
      name: "AES-GCM",
@ciekawy
ciekawy / index.html
Created April 3, 2017 23:46 — forked from d3noob/.block
Simple d3.js Tree Diagram with styling
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Collapsible Tree Example</title>
<style>
.node circle {
@ciekawy
ciekawy / .block
Last active April 3, 2017 22:38 — forked from mbostock/.block
Force-Directed Tree
license: gpl-3.0
@ciekawy
ciekawy / git-tree-setup.md
Last active March 8, 2017 15:48
git tree

command to setup

git config --global alias.tree "log --date-order --date=short  --abbrev-commit --graph --decorate \
  --pretty=format:'%x09%C(yellow)%h | %Cred%ad | %Cblue%ae | %Cgreen%d %Creset%s'"

usage is just git tree with optional params to log command like i.e. git tree --all to show all branches

Raspberry Pi 3 headless wifi AP

this is a quick checklist, detailed description provided in the urls

  • write raspbian ISO image with pv/dd to microSD
  • mount ROOT and boot
  • touch /boot/ssh to enable ssh (important new req)
  • follow below steps described here in details
  • move /etc/init.d/rc2.d/K*ssh to S*ssh
  • edit /etc/wpa_supplicant/wpa_supplicant.conf and provide network {} section with AP SSID and password RPi should connect to
@ciekawy
ciekawy / elastic-header.ts
Last active October 14, 2016 14:25
ElasticHeader updated for recent ionic2 beta.4
import {Directive, ElementRef} from 'angular2/core';
import {Subject} from "rxjs/Subject";
import {Content, IonicApp} from "ionic-angular/index";
/*
* WIP mashup of
* http://www.joshmorony.com/how-to-create-a-directive-in-ionic-2-parallax-header/
* and ionic2 infinite scroll techniques to access properties
* and http://codepen.io/kaemak/pen/mHyKa
* to get desired behaviour on scroll up/down