Skip to content

Instantly share code, notes, and snippets.

View furkantektas's full-sized avatar

Furkan Tektas furkantektas

View GitHub Profile
@furkantektas
furkantektas / main.dart
Created June 25, 2023 01:39
Flutter Material 3 full screen dialog
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@furkantektas
furkantektas / bng2en.py
Created March 11, 2022 22:37
Convert British National Grid References to Easting and Northing coordinates.
#!/usr/bin/env python3
"""
Convert British National Grid References to Easting and Northing coordinates.
Prints the Easting and Northing coordinates of the provided grid reference. Prints south
west point coordinates of reference box by default. You can specify the point of the box
to print by passing the point as the second argument. Accepted values are: "SW", "NW",
"NE", "SE", "MID", "SWNE".
@furkantektas
furkantektas / readme.md
Last active July 6, 2017 20:45
Aruco on OSX Yosemite (python3 and OpenCV 3.2.0)

Assuming you're using brew

  brew install eigen swig numpy
  brew install opencv3 --with-contrib --with-python3 --without-python 
  git clone https://github.com/fehlfarbe/python-aruco.git
  cp swigbuild.sh swigbuild.sh.org
  cp setup.py setup.py.org
@furkantektas
furkantektas / hosts
Created June 30, 2017 17:29
Adblock /etc/hosts file
#adaway adblock
127.0.0.1 wateristian.com
127.0.0.1 logv31.xiti.com
127.0.0.1 ad319m.adk2.co
127.0.0.1 ads.doktoronline.no
127.0.0.1 www.leadgenetwork.com
127.0.0.1 ads.v-links.net
127.0.0.1 ycv.clearshieldredirect.com
127.0.0.1 ssdc.icelandair.com
@furkantektas
furkantektas / batch-classiffier.sh
Last active December 10, 2015 04:26
Batch classification for Weka 3.7+
#!/bin/sh
# This script assumes that the working directory contains 20 training and test arff files
# with prefix training- and test-, respectively. It trains a model using RotationForest (with
# default parameters) and saves the statistical data to results-n.arff where n is the number of
# trainig file.
# Then it prints out the correctly classified instances information to all-results.txt
for i in {1..20}; do
@furkantektas
furkantektas / slicer.sh
Created December 9, 2015 19:48
Test and training data generator
#!/bin/sh
# This script creates a seperate training and test datasets
# using data*.log file. wsize is the window size, i.e. how
# many lines will be gathered from each data*.log file.
# This script creates 20 seperate test & training files
wsize=100
filelen=9999
for i in $(find . -name 'data*.log'); do
templen=$(wc -l < $i)
@furkantektas
furkantektas / get_relevant_many_to_many.sql
Created December 23, 2014 16:52
Get relevant items for many to many relation
# Reference : http://stackoverflow.com/a/7227944/1360267
SELECT
t1.*,
count(DISTINCT r2.relation2) as relevance
FROM pivot_table r1
INNER JOIN pivot_table r2 ON (r1.relation2 = r2.relation2
AND r1.relation1 <> r2.relation1)
INNER JOIN table1 t1 ON (r2.relation1 = t1.id)
WHERE r1.relation1 = '14' -- this is the id results should be related to.
GROUP BY t1.id
@furkantektas
furkantektas / CountDownTimerWidget.java
Created November 20, 2014 23:00
Custom CountDownTimer Widget for Android
package com.furkantektas.braingames.ui;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.CountDownTimer;
import android.util.AttributeSet;
import android.widget.TextView;
import java.text.SimpleDateFormat;
import java.util.Date;
@furkantektas
furkantektas / AspectRatioCardView.java
Created November 16, 2014 11:48
CardView with aspect ratio
package com.furkantektas.braingames.ui;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.v7.widget.CardView;
import android.util.AttributeSet;
import com.furkantektas.braingames.R;
/**
@furkantektas
furkantektas / PointValidator.php
Created September 12, 2014 14:35
PostGIS GeoJSON validator for Yii. Place these files under application/protected/components/
<?php
require_once('SpatialGeoJSONValidator.php');
/**
* PointValidator class for Yii.
* Author: Furkan Tektas github.com/furkantektas
* Date: 2014/09/12
* Version: v1.0
* Sample GeoJSON: {"type":"Point","coordinates":[41.00603847483829,29.009458422660828],"crs":{"type":"name","properties":{"name":"EPSG:4326"}}}
*/
class PointValidator extends SpatialGeoJSONValidator {