Skip to content

Instantly share code, notes, and snippets.

View ceremcem's full-sized avatar

Cerem Cem ASLAN ceremcem

View GitHub Profile
// Generated by LiveScript 1.4.0
var sleep, rfid, stm, esp12, setup, rfidTest, run, onInit;
sleep = require('aea').sleep;
rfid = void 8;
stm = true;
esp12 = false;
setup = function(){
var spiPins, cs;
if (stm && !esp12) {
console.log("----- this is STM32-DISCOVERY");
{sleep} = require \aea
rfid = void
stm = yes
esp12 = no
setup = ->
Time [s] Packet ID MOSI MISO
0.303055 0 0x1A 0x00
0.30312275 1 0x07 0x0C
0.30462875 2 0x02 0x03
0.3046855 3 0x00 0x00
0.30586175 4 0x04 0x00
0.30591625 5 0xF7 0x02
0.30816125 6 0x08 0x00
0.3082155 7 0x7F 0x04
0.31223675 8 0x14 0x7F
Time [s] Packet ID MOSI MISO
0.81563 0 0x1A 0x00
0.81567875 0 0x07 0x0C
0.81610175 1 0x02 0x07
0.8161505 1 0x00 0x00
0.816457 2 0x04 0x00
0.81650575 2 0xF7 0x02
0.8168125 3 0x08 0xF7
0.81686125 3 0x7F 0x04
0.81717 4 0x14 0x7F
@ceremcem
ceremcem / Hostlink.ls
Last active June 18, 2016 16:21
Hostlink protocol implementation
@ceremcem
ceremcem / zip-folder
Created July 15, 2016 12:45
Zip target folder with the same name
#!/bin/bash
FOLDER=$1
zip -r "${FOLDER%/}.zip" "${FOLDER%/}"
TEST: function (){
var a, b, result, expected;
a = {
a: 1,
b: 2,
c: {
ca: 1,
cb: 2
}
};
# Run this script at http://livescript.net
export function merge _obj1, obj2, inplace=no
obj1 = unless inplace
JSON.parse JSON.stringify _obj1
else
_obj1
for p of obj2
t-obj1 = typeof! obj1[p]
if typeof! obj2[p] is \Object
#!/bin/bash
# for question at http://superuser.com/questions/1069702/how-to-expand-a-loop-iterating-over-an-array-dynamically-in-bash/1159076#1159076
req="a b c d"
read -a MODULES <<<$req
i=0
for ((i = 0; i < "${#MODULES[@]}"; i++)); do
MODULE_NAME=${MODULES[$i]}
echo $MODULE_NAME
@ceremcem
ceremcem / unlocking-root-partition-over-ssh.md
Last active July 31, 2021 14:48
How to unlock LUKS root partition on boot via SSH