Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing on JS World

Adson Silva Cicilioti AdsonCicilioti

🎯
Focusing on JS World
  • Brazil
View GitHub Profile
@AdsonCicilioti
AdsonCicilioti / useFetch.ts
Last active Mar 7, 2021
Hook SWR Typescript
View useFetch.ts
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
View hyper.js
// 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 Feb 23, 2017
Download Website converting Links to Relative
View downsite_with_relativelinks.md
View css-breakpoint-mixins.scss
@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 Aug 18, 2016 — forked from ahmadawais/page-login.php
WordPress Frontend Login Page [UPDATED]
View page-login.php
<?php
/**
* Template Name: Login Page AA
*
* Login Page Template.
*
* @author Ahmad Awais
* @since 1.0.0
*/
View anchorSmooth.js
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();
View readme.md

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.

View functions.php
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;
}
View custom-registration.php
<?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
*/
View auto-coupon-woo.php
add_action( 'woocommerce_before_cart', 'apply_matched_coupons' );
function apply_matched_coupons() {
global $woocommerce;
$get1 = 'getonech'; // your coupon code here
$get2 = 'gettwoch'; // your coupon code here
$get3 = 'getthreech'; // your coupon code here
$get4 = 'getfourch'; // your coupon code here
$get5 = 'getfivech'; // your coupon code here