Skip to content

Instantly share code, notes, and snippets.

View nurullahisik's full-sized avatar
😎
funny

NURULLAH IŞIK nurullahisik

😎
funny
View GitHub Profile
@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active April 17, 2025 04:51
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ
@nurullahisik
nurullahisik / session_reset.php
Last active February 12, 2019 12:43
Session Reset
<?php
session_start();
$_SESSION["A"] = "Some New Value"; // set new value
print_r($_SESSION);
$_SESSION["B"] = "Some New Value"; // set new value
$_SESSION["C"] = "Some New Value"; // set new value
print_r($_SESSION);
session_reset(); // old session value restored
print_r($_SESSION);
@nurullahisik
nurullahisik / user_agent.php
Last active February 12, 2019 12:43
Get User Agent with PHP
<?php
function getBrowser()
{
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version= "";
//First get the platform?
if (preg_match('/linux/i', $u_agent)) {
@mhcifci
mhcifci / instagram-photo-downloader.php
Last active September 9, 2018 15:47
Downloading instagram photos with link function
<?php
/**
*
* Author: Mahmut Can
* Date: 20.07.2018
* # Instagram Photo Downloader #
*
**/
@maxivak
maxivak / __upload_file.md
Last active January 30, 2025 19:11
PHP upload file with curl (multipart/form-data)

We want to upload file to a server with POST HTTP request. We will use curl functions.


// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");

// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");
@AlexisLeon
AlexisLeon / rn.input-numbers.js
Created January 15, 2017 04:28
TextInput accepts only numbers - React Native
import React, { Component } from 'react';
import { TextInput } from 'react-native';
class Input extends Component {
constructor(props) {
super(props);
this.state = {
text: ''
};
}
@AndrewChamp
AndrewChamp / .htaccess
Last active February 13, 2024 20:37
Force Port 80 or Port 443 via .htaccess. This will also remove www. from the url.
# FORCE PORT 80 (insecure / regular traffic)
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
###########################################################
#FORCE PORT 443 && REMOVE WWW. (secure / SSL)
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]
@chrisstaite
chrisstaite / stream.php
Created June 22, 2016 20:05
PHP script to load balance between Icecast servers using 302 redirect
<?php
// This is a very noddy script to do 302 redirects to load balance between servers
// as listeners connect. It does no caching, supports a single stream only and requires
// Icecast 2.4 or above (because it uses the status-json.xsl page).
// The server, the minimum users before load balancing, the maximum users, the servers
// are considered in order from top to bottom
$servers = array(
array("http://server1:8000/", 10, 100),
@lesstif
lesstif / curl-get.php
Last active January 19, 2024 11:20
PHP CURL POST example
<?php
$url = 'http://google.com';
if ($argc > 1){
$url = $argv[1];
}
$ch=curl_init();
// user credencial
@ugurozpinar
ugurozpinar / turkce_siralama.js
Created March 21, 2014 09:36
Javascript object array Turkish sorting. Türkçe Sıralama
var arr = [{id:3,title:"Ali"},{id:3,title:"Veli"},{id:3,title:"Vehbi"}];
arr.sort(turkcesiralama);
function turkcesiralama(a, b){
var atitle = a.title;
var btitle = b.title;
var alfabe = "AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpQqRrSsŞşTtUuÜüVvWwXxYyZz0123456789";
if (atitle.length === 0 || btitle.length === 0) {
return atitle.length - btitle.length;
}