Skip to content

Instantly share code, notes, and snippets.

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

Mehmet Hanoğlu mhanoglu

🏠
Working from home
View GitHub Profile
@tufanbarisyildirim
tufanbarisyildirim / sort_array_multidim.php
Created September 15, 2011 23:26
sort a multidimensional array by sql like order by clause
<?php
/**
* @name Mutlidimensional Array Sorter.
* @author Tufan Barış YILDIRIM
* @link http://www.tufanbarisyildirim.com
* @github http://github.com/tufanbarisyildirim
*
* This function can be used for sorting a multidimensional array by sql like order by clause
*
* @param mixed $array
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@codebutler
codebutler / JsonHelper.java
Created April 8, 2012 20:20
Convert Android JSONObject/JSONArray to a standard Map/List.
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();
@msurguy
msurguy / List.md
Last active April 30, 2024 15:14
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@imranismail
imranismail / autocomplete.php
Last active April 4, 2024 13:15
Laravel And JqueryUI's Autocomplete Plugin
//SearchController.php
public function autocomplete(){
$term = Input::get('term');
$results = array();
$queries = DB::table('users')
->where('first_name', 'LIKE', '%'.$term.'%')
->orWhere('last_name', 'LIKE', '%'.$term.'%')
->take(5)->get();
@CGenie
CGenie / console.html
Created August 12, 2014 10:23
Selenium Firefox console log
<html>
<head>
<script type="text/javascript">
console.log('TEST TEST');
window.dump('DUMP DUMP');
console.error('ERROR ERROR');
</script>
</head>
<body>
@barlas
barlas / ready-tr-lower-upper-func.js
Last active January 29, 2024 20:07
javascript - Turkish character lowercase and uppercase functions.
String.prototype.turkishToLower = function(){
var string = this;
var letters = { "İ": "i", "I": "ı", "Ş": "ş", "Ğ": "ğ", "Ü": "ü", "Ö": "ö", "Ç": "ç" };
string = string.replace(/(([İIŞĞÜÇÖ]))/g, function(letter){ return letters[letter]; })
return string.toLowerCase();
}
String.prototype.turkishToUpper = function(){
var string = this;
var letters = { "i": "İ", "ş": "Ş", "ğ": "Ğ", "ü": "Ü", "ö": "Ö", "ç": "Ç", "ı": "I" };
@Ryann10
Ryann10 / TitledEditText.java
Last active February 1, 2020 21:46
TitledEditText allows to write a large font sized title with a content like done in SimpleNote.
import android.content.Context;
import android.text.Editable;
import android.text.Spannable;
import android.text.TextWatcher;
import android.text.style.RelativeSizeSpan;
import android.util.AttributeSet;
import android.widget.EditText;
public class TitledEditText extends EditText implements TextWatcher{
@ikwattro
ikwattro / ws-cli.php
Created October 25, 2015 21:58 — forked from ZiTAL/ws-cli.php
php: simple websocket client
<?php
/*
based on: http://stackoverflow.com/questions/7160899/websocket-client-in-php/16608429#16608429
FIRST EXEC PYTHON SCRIPT TO GET HEADERS
*/
$ws = new ws(array
(
'host' => '127.0.0.1',
'port' => 8080,
@danielgomezrico
danielgomezrico / StatusBarColor.java
Created April 1, 2016 13:37
Android - set status bar color programmatically (just for > lollipop)
public void setStatusBarColor(@ColorRes int statusBarColor) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
int color = ContextCompat.getColor(this, statusBarColor);
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(color);
}
}