Skip to content

Instantly share code, notes, and snippets.

View erayakartuna's full-sized avatar
💭
I may be slow to respond.

Eray Akartuna erayakartuna

💭
I may be slow to respond.
View GitHub Profile
for(i=1;i<=12;i++)
{
$('.col-md-'+i).each(function(){
for(j=1;j<=12;j++)
{
if($(this).hasClass('col-sm-'+j))
{
$(this).removeClass('col-sm-'+j);
$(this).addClass('col-sm-'+i);
}
@erayakartuna
erayakartuna / Spinner_material_design.xml
Last active January 22, 2019 19:05
Android Material Design Widget Spinner
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Spinner
android:id="@+id/subject_spinner"
android:layout_width="1dp"
android:layout_height="1dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
@erayakartuna
erayakartuna / delete_method.php
Created October 15, 2016 14:44
Codeigniter Rest Server Delete Method Example
<?php
public function users_delete()
{
$id = (int) $this->get('id');
$group = (int) $this->delete('group');
$group_2 = (int) $this->delete('group_2');
echo "id : ".$id.'<BR/>';
echo "group : ".$group.'<BR/>';
echo "group 2 : ".$group_2.'<BR/>';
@erayakartuna
erayakartuna / youtube.php
Created October 22, 2016 12:04
Get Youtube Video Cover
function get_youtube_cover($url = '')
{
$arr = parse_url($url);
parse_str($arr['query'],$queries);
return 'http://img.youtube.com/vi/'.$queries['v'].'/hqdefault.jpg';
}
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class DENEME extends JFrame
{
public static final int WIDTH = 300;
public static final int HEIGHT = 300;
public static JTextField textfield_1;
@erayakartuna
erayakartuna / log.go
Last active January 2, 2022 19:19
Save Logging
// SaveRequest with request and response
func SaveRequest(url string, reqBody string, respStatus int, resp string) {
r := fmt.Sprintf(
`{"url": "%s", "reqBody": "%s", "respStatus": "%d", "resp": "%s"\n`,
jsonEscape(url),
jsonEscape(reqBody),
respStatus,
jsonEscape(resp),
)
type RequestLogs struct {
responses []string
sync.Mutex
}
var logs RequestLogs
// InitRequestLogs ...
func InitRequestLogs() {
go func() {
@erayakartuna
erayakartuna / Logv1.go
Created January 2, 2022 20:10
Logv1.go
type requestLogs struct {
logs []string
sync.Mutex
}
var reqLogs requestLogs
func LogRequest(url string, reqBody string, respStatus int, resp string) {
l := fmt.Sprintf(
`{"url": "%s", "reqBody": "%s", "respStatus": "%d", "resp": "%s"\n\r`,
@erayakartuna
erayakartuna / Logv2.go
Created January 2, 2022 20:37
Logv2.go
type requestLogs struct {
logs []string
sync.Mutex
}
var reqLogs requestLogs
// InitRequestLogs ...
func InitRequestLogs() {
go func() {
@erayakartuna
erayakartuna / Logv4.go
Last active January 2, 2022 21:37
Logv4.go
// InitRequestLogs ...
func InitRequestLogs() {
go func() {
for {
time.Sleep(time.Second * 5)
writeLogs()
}
}()
}