Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<style>div { margin:3px; width:40px; height:40px;
position:absolute; left:0px; top:30px;
background:green; display:none; }
div.newcolor { background:blue; }
span { color:red; } </style>
<script src="/scripts/jquery-1.4.js"></script>
</head>
@ademalp
ademalp / Aklınızı Rahata Erdirecek 50 Soru
Created June 15, 2012 13:14
Aklınızı Rahata Erdirecek 50 Soru
Aklınızı Rahata Erdirecek 50 Soru
1. Kaç yaşında olduğunuzu bilmeseniz kaç yaşında olurdunuz?
2. Başarısızlığa uğramak mı hiç denememek mi daha kötüdür?
3. Hayat o kadar kısaysa neden sevmediğimiz o kadar şeyi yapıyor ve yapmadığımız o kadar şeyi seviyoruz?
4. Her şey yapılıp söylendiğinde söyledikleriniz yaptıklarınızdan daha mı fazladır?
<?php
$ip_adresleri = array(
"2607:f0d0:1002:51::4",
"2607:f0d0:1002:0051:0000:0000:0000:0004",
"212.20.19.10",
"212.0.1",
"212.a.b.112"
) ;
foreach($ip_adresleri as $ip_adresi)
{
@ademalp
ademalp / httpd_mem
Last active December 14, 2015 11:59
#!/bin/bash
sunucu="SERVER4"
eposta="admin@vizyon.net.tr"
uyari=12000
restart=15000
toplam=0
for val in $(ps -C httpd -o vsz=)
do
#!/bin/bash
# httpd.load.sh
# Script to check the 1-minute server load and sends a mail.
# script must be run as root; we run it from crontab every five minutes
# Copyright (C) NoBaloney Internet Services
# Licensed under GNU General Public License, Version 2
# Required Customizations:
SERVER_NAME="SERVER4"
EMAIL_ADDRESS="admin@vizyon.net.tr"
<?php
$xml = json_decode(json_encode((array) simplexml_load_file("https://api.twitter.com/1/followers/ids.xml?screen_name=BerkayGmstkn")), 1);
$takipciler = $xml['ids']['id'];
$xml = json_decode(json_encode((array) simplexml_load_file("https://api.twitter.com/1/following/ids.xml?screen_name=BerkayGmstkn")), 1);
$takip_edilenler=$xml['ids']['id'];
var_export(array_diff($takipciler,$takip_edilenler));
@ademalp
ademalp / image.php
Created March 27, 2013 08:15
Resimleri ajax ile html'ye aktarmak
<?php
function resize($resim, $max_en, $max_boy)
{
$boyut = getimagesize($resim);
$en = $boyut[0];
$boy = $boyut[1];
$x_oran = $max_en / $en;
$y_oran = $max_boy / $boy;
@ademalp
ademalp / array_pattern.php
Created March 27, 2013 09:15
POST ya da herhangi bir dizinin keylerini verilen patterne göre filtreler.
<?php
function array_pattern($array,$pattern)
{
$return = array();
foreach($array as $key => $value)
{
$ret = sscanf($key, $pattern);
$pass = true;
foreach($ret as $val)
@ademalp
ademalp / thumb.php
Last active December 17, 2015 09:59
<?php
$i = isset($_GET['f']) ? $_GET['f'] : "";//$yok;
$x = isset($_GET['w']) ? intval($_GET['w']) : 100;
$y = isset($_GET['h']) ? intval($_GET['h']) : 0;
$noimage = false;
if (is_file($i))
{
list($w, $h, $t) = getimagesize($i);
if (in_array($t, array(1, 2, 3))) {
<?php
function encrypt($plaintext,$plainkey){
$key = pack('H*', "$plainkey");
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$plaintext_utf8 = utf8_encode($plaintext);
$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key,