Skip to content

Instantly share code, notes, and snippets.

<?php
function etkinliksil() {
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
remove_action('wp_head', 'rsd_link');
class WP_HTML_Compression
{
// Settings
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
protected $remove_comments = true;
// Variables
protected $html;
find . -name "*.png" -exec optipng -o7 {} \;
find . -iname "*.jpg" -exec jpegoptim -m80 -o -p {} \;
var OBJECTFALSE = new Array();
function contactFormKontrol()
{
var retVal = true;
if(OBJECTFALSE.length > 0){
for(var i=0; i<OBJECTFALSE.length; i++){
$("#"+OBJECTFALSE[i]).css({"background":"#ffffff"});
}
DELETE FROM reads WHERE user_id NOT IN (SELECT id FROM users)
$(document).ready(function(){
var $flowers = $('#flower-items');
$('#flower-items').find('a').on('click', function(e){
alert('a');
e.preventDefault();
var $desc = $('#flower-description');
switch($(this).attr('href')) {
case 'calla.html' :
alert('b')
$desc.load('fragments/lilies.html');
<p>
<b>Ad Soyad </b><br>
[text* adsoyad]
<br>
<b>Doğum Tarihi</b><br>
[date* dogumtarihi]<br>
<b>Medeni Durum</b><br>
[select* medenidurum include_blank "Evli" "Bekar"]
<br>
<b>Eğitim Durumu</b><br>
@alicanatas
alicanatas / gist:335dfeb962675ec23b8b3734c5bacaf0
Created October 1, 2018 10:15
PHP get device IOS / ANDROID or PC
function user_agent(){
$iPod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = strpos($_SERVER['HTTP_USER_AGENT'],"iPad");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
file_put_contents('./public/upload/install_log/agent',$_SERVER['HTTP_USER_AGENT']);
if($iPad||$iPhone||$iPod){
return 'ios';
}else if($android){
return 'android';
SELECT username, COUNT(*) c FROM users GROUP BY username HAVING c > 1 ORDER BY c DESC
<?php
$c = new CDbCriteria();
Hoge::model()->findAll($c);
// SELECT * FROM `hoge` `t`
$c = new CDbCriteria();
$c->addSearchCondition('t.fuga', null); // null, false, ''などは無視されるようです
Hoge::model()->findAll($c);