Skip to content

Instantly share code, notes, and snippets.

View kakkoyun's full-sized avatar
🏠
Working from home

Kemal Akkoyun kakkoyun

🏠
Working from home
View GitHub Profile
@kakkoyun
kakkoyun / Berlin DevOps Meetup.md
Last active January 29, 2024 18:53
Berlin DevOps Meetup.md
@kakkoyun
kakkoyun / pyoffset.md
Last active September 14, 2023 18:16
python print offset
static inline __attribute__((__always_inline__)) void print_python_version_offsets(PythonVersionOffsets *pvo) {
  bpf_printk("Python Version Offsets:\n");
  bpf_printk("  major_version: %u\n", pvo->major_version);
  bpf_printk("  minor_version: %u\n", pvo->minor_version);
  bpf_printk("  patch_version: %u\n", pvo->patch_version);
  bpf_printk("  py_object:\n");
  bpf_printk("    ob_type: %lld\n", pvo->py_object.ob_type);
  bpf_printk("  py_string:\n");
  bpf_printk("    data: %lld\n", pvo->py_string.data);

Keybase proof

I hereby claim:

  • I am kakkoyun on github.
  • I am kemal (https://keybase.io/kemal) on keybase.
  • I have a public key ASBDhPtOiAyHRvtq3vp0bU7a7QfP538sm25IIluYUYT0wwo

To claim this, I am signing this object:

@kakkoyun
kakkoyun / EventBus.java
Created February 18, 2016 15:29
An Otto event bus subclass with force UI dispatch and stick events
package co.vispera.shark.miscellaneous;
import android.os.Handler;
import android.os.Looper;
import com.squareup.otto.Bus;
import com.squareup.otto.Produce;
import java.util.concurrent.ConcurrentHashMap;
@kakkoyun
kakkoyun / infixeval.cpp
Created December 8, 2015 09:24 — forked from haldun/infixeval.cpp
infix evaluator in c++
/*
* Infix evaluator in C++.
* Haldun Bayhantopcu <hb@haldun.me> 10976008
*
* Usage: echo <expr> | ./infixeval
* Example: echo "((8+9)*(4-6)^4)" | ./infixeval
* Output: 272
*/
#include <cmath>
#include <iostream>
@kakkoyun
kakkoyun / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kakkoyun
kakkoyun / gist:2b38657bbdf4d8d6e5b8
Created April 12, 2015 19:40
Passports Controller
class Api::V1::PassportsController < Api::V1::BaseController
before_action :validate
def create
if (passport = Passport.where(uid: params[:uid],
provider: params[:provider]).first)
respond_with(current_application.password.get_token(passport.user,
passport.user.password),
location: false)
# member = passport.user
'''
adminreverse from here http://djangosnippets.org/snippets/2032/
changed for working with ForeignKeys
'''
'''
reverseadmin
============
Module that makes django admin handle OneToOneFields in a better way.
A common use case for one-to-one relationships is to "embed" a model
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'

Architectural Questions

  • Are responsibilities well defined?
  • Are the collaborations well defined?
  • Is coupling minimized?
  • Can you identify potential duplication?
  • Are interface definitions and constraints acceptable?
  • Can modules access needed data—when needed?