Skip to content

Instantly share code, notes, and snippets.

@hakandilek
hakandilek / bash-arrays.md
Created March 12, 2021 11:16
bash arrays
Syntax Description
arr=() Create an empty array
arr=(1 2 3) Initialize array
${arr[2]} Retrieve third element
${arr[@]} Retrieve all elements
${!arr[@]} Retrieve array indices
${#arr[@]} Calculate array size
arr[0]=3 Overwrite 1st element
arr+=(4) Append value(s)
@hakandilek
hakandilek / git-remove-submodule.md
Created February 24, 2021 08:12
removing a submodule

Remove the submodule entry from .git/config

git submodule deinit -f path/to/submodule

Remove the submodule directory from the superproject's .git/modules directory

rm -rf .git/modules/path/to/submodule
git submodule deinit <path_to_submodule>
git rm <path_to_submodule>
git commit-m "Removed submodule "
rm -rf .git/modules/<path_to_submodule>
@hakandilek
hakandilek / index.js
Created December 16, 2017 19:19
requirebin sketch
var autobahn = require('autobahn');
var wsuri = "wss://api.poloniex.com";
var connection = new autobahn.Connection({
url: wsuri,
realm: "realm1"
});
connection.onopen = function (session) {
function marketEvent (args,kwargs) {
console.log(args);
0xE22CBeeF0D322F3217b6cAeC494Ee4037C84A10d

#Chocolatey Commands

update all installed packages

cup all -y

list all installed packages

@hakandilek
hakandilek / optware.sh
Created April 18, 2015 08:11
synology optware.sh
#!/bin/sh
#
# Optware setup
# Alternatives Optware Startup und Shutdown Script #/usr/local/etc/rc.d/optware.sh
#
case $1 in
start)
[ ! -h /opt -a ! -d /opt ] && ln -s /volume1/@optware /opt
for i in /opt/etc/init.d/S??* ;do
#
@hakandilek
hakandilek / keybase.md
Created September 23, 2014 17:37
keybase.md

Keybase proof

I hereby claim:

  • I am hakandilek on github.
  • I am hakan (https://keybase.io/hakan) on keybase.
  • I have a public key whose fingerprint is 7A42 539A 5C06 A8AD 69A7 AE95 15BA D9DC 6C79 A132

To claim this, I am signing this object:

// jersey resources
Map<String, Object> resources = ctx.getBeansWithAnnotation(Path.class);
for (Map.Entry<String, Object> entry : resources.entrySet()) {
Object resource = entry.getValue();
Class<? extends Object> cls = resource.getClass();
if (cls.isAnnotationPresent(Path.class))
System.out.println(cls);
jersey.register(resource);
}
@hakandilek
hakandilek / hosts
Last active September 4, 2015 16:43
Hosts for Turkey
199.59.150.7 twitter.com
199.59.148.10 twitter.com
199.59.150.39 twitter.com
199.59.148.82 twitter.com
199.59.149.198 twitter.com
199.59.149.230 twitter.com
141.211.125.17 www.twitter.com
199.59.150.7 www.twitter.com
199.59.148.10 www.twitter.com
199.59.150.39 www.twitter.com