Skip to content

Instantly share code, notes, and snippets.

@hakandilek
hakandilek / example.py
Last active October 9, 2024 08:42
Python property overrides
class A:
def __init__(self, name):
self._name = name
@property
def name(self):
return self._name
@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);
}