Skip to content

Instantly share code, notes, and snippets.

View AdsonCicilioti's full-sized avatar
🎯
Focusing on JS World

Adson Cicilioti AdsonCicilioti

🎯
Focusing on JS World
  • Brazil
View GitHub Profile
@AdsonCicilioti
AdsonCicilioti / cpt-produto.php
Created August 15, 2023 16:49
"Produto" custom post type, "Linha de Produto" and "Categoria de Produto" taxonomies.
<?php
function flora_ndb_register_cpt_produto() {
/**
* Post Type: Produtos.
*/
$labels = array(
'name' => __( 'Produtos', 'flora_ndb' ),
'singular_name' => __( 'Produto', 'flora_ndb' ),
'menu_name' => __( 'Produtos', 'flora_ndb' ),
@AdsonCicilioti
AdsonCicilioti / useFetch.ts
Last active March 7, 2021 01:00
Hook SWR Typescript
import useSWR, { ConfigInterface, responseInterface } from 'swr'
export const fetcher = async (url: string): Promise<any> => {
const response = await fetch(url)
const data = await response.json()
return data
}
export function useFetch<Data = any, Error = any>(
url: string,
config?: ConfigInterface
@AdsonCicilioti
AdsonCicilioti / hyper.js
Created June 24, 2019 20:59
My Hyper Prefs
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@AdsonCicilioti
AdsonCicilioti / downsite_with_relativelinks.md
Last active February 23, 2017 20:01
Download Website converting Links to Relative
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-portait-only {
@media (min-width: 600px) and (max-width: 899px) { @content; }
}
@mixin for-tablet-landscape-up {
@AdsonCicilioti
AdsonCicilioti / page-login.php
Created August 18, 2016 14:35 — forked from ahmadawais/page-login.php
WordPress Frontend Login Page [UPDATED]
<?php
/**
* Template Name: Login Page AA
*
* Login Page Template.
*
* @author Ahmad Awais
* @since 1.0.0
*/
jQuery(document).ready(function($) {
////// ANCHOR SMOOTH
$('a[href^="#"]').click(function(e) {
e.preventDefault();
anchorScroll( $(this), $($(this).attr('href')), 800 );
});
function anchorScroll(this_obj, that_obj, base_speed) {
var this_offset = this_obj.offset();
@AdsonCicilioti
AdsonCicilioti / readme.md
Last active September 4, 2015 20:56
Dropbox Ignore

Bash command for ignore casual development folders

A simple line code that makes adding folders to the exclusion of Dropbox sync.

find `pwd` -type d -regex ".*\(node_modules\|temp\|tmp\|bower_components\|cache\)$" -prune -exec dropbox-cli exclude add {} \;

Enable Dropbox command line

With Dropbox Python Script

After your Dropbox properly installed, configure your dropbox.py file to enable dropbox-cli command line.

add_filter( 'wc_order_is_editable', 'wc_make_processing_orders_editable', 10, 2 );
function wc_make_processing_orders_editable( $is_editable, $order ) {
if ( $order->get_status() == 'processing' ) {
$is_editable = true;
}
return $is_editable;
}
<?php
/*
Plugin Name: Custom Registration
Description: Updates user rating based on number of posts.
Version: 1.1
Author: Tristan Slater w/ Agbonghama Collins
Author URI: http://kanso.ca
*/