Skip to content

Instantly share code, notes, and snippets.

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

Çağrı Üçkan cagriuckan

🏠
Working from home
View GitHub Profile
@pupunzi
pupunzi / mb-block.js
Last active June 26, 2021 23:39
A simple Wordpress Gutenberg plug-in
/**
* mb Gutemberg block
* Copyright (c) 2001-2018. Matteo Bicocchi (Pupunzi)
*/
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
TextareaControl = wp.components.TextareaControl,
InspectorControls = wp.editor.InspectorControls;
@mfd
mfd / GTWalsheimPro.css
Last active February 10, 2024 19:59
GT Walsheim Pro
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Regular"),local("GTWalsheimProRegular"),url(GTWalsheimProRegular.woff2) format("woff2"),url(GTWalsheimProRegular.woff) format("woff"),url(GTWalsheimProRegular.ttf) format("truetype");
font-weight: 400;
font-style: normal
}
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Bold"),local("GTWalsheimProBold"),url(GTWalsheimProBold.woff2) format("woff2"),url(GTWalsheimProBold.woff) format("woff"),url(GTWalsheimProBold.ttf) format("truetype");
@AustinGil
AustinGil / functions.php
Last active September 14, 2020 11:56
JSON-LD for WordPress posts
/**
* Remove hentry from post_class
* This is important to not get schema errors
*/
function visceral_remove_hentry_class( $classes ) {
$classes = array_diff( $classes, array( 'hentry' ) );
return $classes;
}
add_filter( 'post_class', 'visceral_remove_hentry_class' );
@jaredatch
jaredatch / functions.php
Last active July 3, 2023 23:10
WordPress Search Autocomplete using admin-ajax.php
<?php
/**
* Enqueue scripts and styles.
*
* @since 1.0.0
*/
function ja_global_enqueues() {
wp_enqueue_style(
'jquery-auto-complete',
@ajskelton
ajskelton / WP Customizer - Select
Last active June 24, 2021 19:36
Add a Select field to the WordPress Customizer.
$wp_customize->add_setting( 'themeslug_select_setting_id', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'themeslug_sanitize_select',
'default' => 'value1',
) );
$wp_customize->add_control( 'themeslug_select_setting_id', array(
'type' => 'select',
'section' => 'custom_section', // Add a default or your own section
'label' => __( 'Custom Select Option' ),
@andrastudio
andrastudio / vc-fonts.php
Created September 19, 2016 02:07
Add new google fonts to Visual Composer Custom Heading
if ( ! function_exists( 'helper_vc_fonts' ) ) {
function helper_vc_fonts( $fonts_list ) {
$poppins->font_family = 'Poppins';
$poppins->font_types = '300 light regular:300:normal,400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal,700 bold regular:700:normal';
$poppins->font_styles = 'regular';
$poppins->font_family_description = esc_html_e( 'Select font family', 'helper' );
$poppins->font_style_description = esc_html_e( 'Select font styling', 'helper' );
$fonts_list[] = $poppins;
return $fonts_list;
@richardtorres314
richardtorres314 / flexbox.scss
Last active March 4, 2024 14:41
CSS Flexbox - Sass Mixins
// --------------------------------------------------
// Flexbox SASS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
@mixin flexbox {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
@Rodrigo54
Rodrigo54 / php-html-css-js-minifier.php
Last active April 23, 2024 23:58 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@agusmu
agusmu / spp.php
Last active August 18, 2019 16:25 — forked from khromov/spp.php
<?php
/*
Plugin Name: Simple Popular Posts Lite
Plugin URI: -
Description: -
Version: 2014.10.16
Author: khromov
Author URI: http://snippets.khromov.se
License: GPL2
*/
@aladagemre
aladagemre / sehirler.html
Created November 10, 2014 17:50
Türkiye Şehir Listesi HTML Select Option
<select name="Sehir">
<option value="0">------</option>
<option value="1">Adana</option>
<option value="2">Adıyaman</option>
<option value="3">Afyonkarahisar</option>
<option value="4">Ağrı</option>
<option value="5">Amasya</option>
<option value="6">Ankara</option>
<option value="7">Antalya</option>
<option value="8">Artvin</option>