Skip to content

Instantly share code, notes, and snippets.

View marjinal1st's full-sized avatar
🥃
Master of Ballmer Peak

Ahmet Sezgin DURAN marjinal1st

🥃
Master of Ballmer Peak
View GitHub Profile
@marjinal1st
marjinal1st / gist:7870389
Created December 9, 2013 10:44
HABTM Error
Kebapress::Post.includes(:categories).where(categories: { count: 0 })
SQL (0.3ms) SELECT "kebapress_posts"."id" AS t0_r0, "kebapress_posts"."title" AS t0_r1, "kebapress_posts"."body" AS t0_r2, "kebapress_posts"."published_at" AS t0_r3, "kebapress_posts"."commentable" AS t0_r4, "kebapress_posts"."published" AS t0_r5, "kebapress_posts"."author_id" AS t0_r6, "kebapress_posts"."created_at" AS t0_r7, "kebapress_posts"."updated_at" AS t0_r8, "kebapress_categories"."id" AS t1_r0, "kebapress_categories"."title" AS t1_r1, "kebapress_categories"."created_at" AS t1_r2, "kebapress_categories"."updated_at" AS t1_r3 FROM "kebapress_posts" LEFT OUTER JOIN "kebapress_categories_posts" ON "kebapress_categories_posts"."post_id" = "kebapress_posts"."id" LEFT OUTER JOIN "kebapress_categories" ON "kebapress_categories"."id" = "kebapress_categories_posts"."category_id" WHERE "categories"."count" = 0
SQLite3::SQLException: no such column: categories.count: SELECT "kebapress_posts"."id" AS t0_r0, "kebapress_posts"."title" AS t0_
@marjinal1st
marjinal1st / move_test
Last active August 29, 2015 14:19
Robot
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from robot1_base_02.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot name="robot1_xacro" xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller" xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor" xmlns:xacro="http://www.ros.org/wiki/xacro">
<link name="base_footprint">
<visual>
<geometry>
<box size="0.001 0.001 0.001"/>
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
import cv2
from sensor_msgs.msg import Image
from cv_bridge import *
def callback(msg):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
from geometry_msgs.msg import Twist
def main():
rospy.init_node("move_test", anonymous=False)
@marjinal1st
marjinal1st / chip8-emu.rb
Created January 3, 2015 14:51
CHIP-8 Ruby Emülatörü
class CHIP8
attr_accessor :memory, :gpio, :display_buffer, :stack,
:key_inputs, :fonts, :opcode, :index, :pc,
:delay_timer, :sound_timer, :should_draw,
:instructions, :vx, :vy
def initialize
@memory = [0] * 4096 # 4096 Baytlık belleğimiz
@gpio = [0] * 16 # 16 tane genel amaçlı register'ı tutan bir dizi
@display_buffer = [0] * 2048 # 64 * 32 = 2048 piksellik ekranımız
Domain Name: BMRF.US
Domain ID: D37352589-US
Sponsoring Registrar: ENOM, INC.
Sponsoring Registrar IANA ID: 48
Registrar URL (registration services): whois.enom.com
Domain Status: clientTransferProhibited
Variant: BMRF.US
Registrant ID: 659C99C8A93B9E50
Registrant Name: Josh Hubi
Registrant Organization: PixelBlast Media
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import pygame
from pygame.locals import *
import sys
from sprite_anim import *
pygame.init()
@marjinal1st
marjinal1st / gist:8c4c700c84ae33185b96
Created December 14, 2014 17:52
python-sfml build error 2
marjinal1st@thinkpad-edge:~/Python/python-sfml$ python setup.py install
running install
running build
running build_py
copying src/sfml/__init__.py -> build/lib.linux-x86_64-2.7/sfml
copying src/sfml/sf.py -> build/lib.linux-x86_64-2.7/sfml
running build_ext
cythoning src/sfml/system.pyx to src/sfml/system.cpp
building 'sfml.system' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Iinclude -I/usr/include/python2.7 -c src/sfml/system.cpp -o build/temp.linux-x86_64-2.7/src/sfml/system.o -fpermissive
@marjinal1st
marjinal1st / gist:03f9e6daeaeb3f2aafc7
Created December 14, 2014 17:30
python-sfml build error
(venv)marjinal1st@thinkpad-edge:~/Python/python-sfml$ python setup.py install
running install
running build
running build_py
running build_ext
cythoning src/sfml/system.pyx to src/sfml/system.cpp
Error compiling Cython file:
------------------------------------------------------------
...
@marjinal1st
marjinal1st / gist:db948f4f247fd0a29b65
Created November 19, 2014 20:29
updated builder script
#!/bin/bash
## Exit trap
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
set -e
## Fancy echo
fancy_echo() {
printf "\n%b\n" "$1"