Skip to content

Instantly share code, notes, and snippets.

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

Ola Dayo iAmServer

🏠
Working from home
View GitHub Profile
<?php
add_action( 'woocommerce_before_calculate_totals', 'add_custom_price', 10, 1);
function add_custom_price( $cart_obj ) {
// This is necessary for WC 3.0+
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
// Avoiding hook repetition (when using price calculations for example)
if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 )
@iAmServer
iAmServer / sliding-segments.page.html
Created February 9, 2020 11:25 — forked from mdorchain/sliding-segments.page.html
Ionic 4 Sliding segments
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title>
Demo
</ion-title>
</ion-toolbar>
</ion-header>
@iAmServer
iAmServer / Tutorial.md
Created January 27, 2020 07:46
A short discord.js tutorial with examples

Discord.js Tutorial - a short tutorial

After this tutorial you are able to code a cool bot with many commands and a level system.

Setup

Did you ever want to write your own bot but you think you are too bad for it or you don't have motivation to do so? Stop thinking that way. Writing discord bots using discord.js is really, really, easy if you know some javascript basics.

In this tutorial we will use some ES6, which makes javascript more powerful. If you have never heard of ES6, I'll explain some stuff whenever I use it. Found a mistake? Just comment.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
ul {
display: block;
list-style: none;
@iAmServer
iAmServer / share-linkedin.js
Created December 5, 2017 06:22 — forked from McKinneyDigital/share-linkedin.js
Share to Linkedin using Javascript
// Opens a pop-up with a Linkedin share dialog
var url = "http://google.com";
var title = "Replace this with a title.";
var text = "Replace this with your share copy.";
window.open('http://www.linkedin.com/shareArticle?mini=true&url='+encodeURIComponent(url), '', 'left=0,top=0,width=650,height=420,personalbar=0,toolbar=0,scrollbars=0,resizable=0');
@iAmServer
iAmServer / .htaccess
Created September 16, 2017 02:10 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/