This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* PointValidator class for Yii. | |
* Author: Furkan Tektas github.com/furkantektas | |
* Date: 2014/09/05 | |
* Version: v1.0 | |
*/ | |
class PointValidator extends CValidator | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ModelName extends Eloquent { | |
// Ref: http://stackoverflow.com/a/23750526 | |
// Assuming Point is entered as text. Eg: 41,29 | |
public function setLocationAttribute($value) { | |
$loc = explode(',',$value); | |
$this->attributes['location'] = DB::raw("ST_GeomFromText('POINT(".$loc[0]." ".$loc[1].")', 4326)"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DatePickerFragment extends DialogFragment | |
implements DatePickerDialog.OnDateSetListener { | |
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
// Use the current date as the default date in the picker | |
final Calendar c = Calendar.getInstance(); | |
final int year = c.get(Calendar.YEAR); | |
final int month = c.get(Calendar.MONTH); | |
final int day = c.get(Calendar.DAY_OF_MONTH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="tr.edu.gyte.android.cellinfogsm" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-sdk | |
android:minSdkVersion="18" | |
android:targetSdkVersion="18" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <hidef.h> /* common defines and macros */ | |
#include "derivative.h" /* derivative-specific definitions */ | |
#include <stdio.h> /* derivative-specific definitions */ | |
#include <stdlib.h> | |
#include "lcd.h" | |
#pragma CODE_SEG __NEAR_SEG NON_BANKED | |
// ASM | |
#define enable_intr() __asm(cli) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Standard C++ Libraries | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <opencv2/core/core.hpp> | |
#include <opencv2/imgproc/imgproc.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
using std::cout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Streaming Url: rtsp://RASPBERRYIP:8080/stream.sdp/ | |
raspivid -o - -t 0 -w 640 -h 480 -fps 25 -n | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8080/stream.sdp/}' :demux=h264 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# starting raspberry camera stream at http://RASPBERRYIP:8090 | |
raspivid -o - -t 0 -hf -vf -w 640 -h 480 -fps 15 | cvlc stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo nmap -sP 192.168.2.* | grep -B 2 -i raspberry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.text.TextPaint; | |
import android.text.style.TypefaceSpan; | |
/** | |
* Created by Furkan Tektas on 15.02.2014. | |
*/ | |
public class ShadowedTypefaceSpan extends TypefaceSpan { | |
private float radius; | |
private float dx; | |
private float dy; |