Skip to content

Instantly share code, notes, and snippets.

View mijankarim's full-sized avatar
:octocat:
Working from home

Mijanul Karim mijankarim

:octocat:
Working from home
  • United Kingdom
View GitHub Profile
var x = [ 10, 20, 30];
var sum = 0;
for(var i = 0; i < x.length; i++){
sum = sum + x[i]
}
console.log("The sum result is " + sum);
@mijankarim
mijankarim / script.js
Created August 17, 2019 10:20
Selection Sort JS
const numbers = [99,44,6,2,1,5,63,87,283,4,0];
function selectionSort(array){
const length = array.length;
for( let i = 0; i < length; i++ ){
for( let j = 0; j < length; j++){
if(array[j] > array[j+1]){
let temp = array[j];
array[j] = array[j+1];
array[j+1] = temp;
add_filter( 'woocommerce_cart_item_name', 'custom_variation_item_name', 10, 3 );
function custom_variation_item_name( $item_name, $cart_item, $cart_item_key ){
// Change item name only if is a product variation
if( $cart_item['data']->is_type('variation') ){
// HERE customize item name
$item = $cart_item['data'];
$item_name = $item->get_name();
// For cart page we add back the product link
if(is_cart())
1. String Reversal
2. Palindrome
3. Integer Reversal
4. Fizz Buzz
5. Max Character