Skip to content

Instantly share code, notes, and snippets.

View ceremcem's full-sized avatar

Cerem Cem ASLAN ceremcem

View GitHub Profile
@ceremcem
ceremcem / package-lock-diff.patch
Created September 12, 2017 20:36
some description
diff --git a/package-lock.json b/package-lock.json
index 8aec82b..aa149be 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,6 +14,16 @@
"through2": "2.0.3"
}
},
+ "JSONStream": {
+ "version": "1.3.1",
@ceremcem
ceremcem / fizzbuzz.ls
Created September 5, 2017 00:13 — forked from ykhs/fizzbuzz.ls
fizzbuzz with LiveScript
global <<< require \prelude-ls
fizzbuzz = (x) ->
| x % 15 is 0 => \fizzbuzz
| x % 5 is 0 => \buzz
| x % 3 is 0 => \fizz
| otherwise => x
[1 to 100] |> map fizzbuzz |> each console.log
@ceremcem
ceremcem / tmux-cheatsheet.markdown
Created July 2, 2017 20:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/bin/bash
screen -wipe
screen -mdS mytest bash -c 'for i in {1..10}; do echo "this is $i" > myfile; sleep 1; done'
PID=$(screen -list | grep mytest | cut -f1 -d'.' | sed 's/\W//g')
echo "PID is: $PID"
pause () {
echo "pausing process $PID"
kill -STOP $PID
@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
#!/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
# 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
TEST: function (){
var a, b, result, expected;
a = {
a: 1,
b: 2,
c: {
ca: 1,
cb: 2
}
};
@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%/}"
@ceremcem
ceremcem / Hostlink.ls
Last active June 18, 2016 16:21
Hostlink protocol implementation