Skip to content

Instantly share code, notes, and snippets.

View qutek's full-sized avatar
💻
Working from home

Lafif Astahdziq qutek

💻
Working from home
View GitHub Profile
@qutek
qutek / functions.php
Created April 10, 2014 08:05
Woocommerce Redirect After Clicking "Place Order" Button
<?php
/*========================================================
Custom Thankyou Page Woocommerce
Woocommerce snippest to redirect user after order sucessed
Place it to functions.php in theme directory
=========================================================*/
add_action( 'woocommerce_thankyou', function(){
global $woocommerce;
$order = new WC_Order();
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@qutek
qutek / LimitChar.php
Last active August 29, 2015 14:00
Limit Character Wordpress Archive
<?php
/********************
Limit karakter untuk archive
*********************/
function content($limit, $more='Read More') {
$content = explode(' ', get_the_content(), $limit);
if (count($content)>=$limit) {
array_pop($content);
$content = implode(" ",$content).' <a href="'.get_permalink().'">'.$more.'</a>';
@qutek
qutek / install-copy-sync-ubuntu
Created May 13, 2014 11:01
Install Copy Sync Ubuntu
wget https://copy.com/install/linux/Copy.tgz
tar -xvzf Copy.tgz
# optional clean-up
rm Copy.tgz
# If your Ubuntu is Ubuntu 64bits:
cd copy/x86_64
# If your Ubuntu is Ubuntu 32bits:
@qutek
qutek / command-tweak-ubuntu.md
Last active August 29, 2015 14:01
Tweak Ubuntu

#####Enter following command to disable auto open nautilus window after mount Terminal Command:

gsettings set org.gnome.desktop.media-handling automount-open false

#####Enter following command in terminal to disable overlay scrollbar Terminal Command:

gsettings set com.canonical.desktop.interface scrollbar-mode normal

@qutek
qutek / clone-form.html
Created June 11, 2014 10:25
Jquery Clone Form
<form>
<div id="container">
<input type="text" value="" /><br />
<textarea></textarea><br />
<select>
<option value="1" selected="selected">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select><br/>
<select>
@qutek
qutek / snipet.php
Created June 18, 2014 07:10
Add Custom Media Upload Worpress
/*************************
* Enqueue Media Uploader
*************************/
function enqueue_admin_scripts() {
if(function_exists('wp_enqueue_media')) {
wp_enqueue_media();
}
else {
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
@qutek
qutek / woocommerce-ajax.php
Last active May 27, 2024 16:04
[Wordpress] [Woocommerce] WooCommerce Ajax Handlers
<?php
/**
* WooCommerce Ajax Handlers
*
* Handles AJAX requests via wp_ajax hook (both admin and front-end events)
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/** Frontend AJAX events **************************************************/
@qutek
qutek / email-confirmation.php
Created August 8, 2014 17:46 — forked from elclanrs/email-confirmation.php
[Wordpress] Custom email confirmation on registration
<?php
/**
* Plugin Name: Email Confirmation
* Description: Send an email to the user with confirmation code and store form data in database until user confirms.
* Author: Cedric Ruiz
*/
class EmailConfirmation
{
const PREFIX = 'email-confirmation-';