Skip to content

Instantly share code, notes, and snippets.

View hakimzulkufli's full-sized avatar
💭
I may be slow to respond.

Hakim Zulkufli hakimzulkufli

💭
I may be slow to respond.
View GitHub Profile
<?php
$str = "";
for($i = 1; $i<=7; $i++)
{
if($i <= 4) {
for($j=1; $j<=$i; $j++) {
$str .= "#";
}
} else if($i == 7) {
<?php
$n = 5;
$str = "";
for($i = 1; $i<=$n; $i++) // row
{
for($j = 1; $j<=$n; $j++) // column
{
if(($j + $i) % 2 == 0) // print bila row+column ialah genap
$str .= "#";
@hakimzulkufli
hakimzulkufli / chess_board.html
Last active August 18, 2018 10:51
Print chess board. Alternate solution. Demo: https://codepen.io/anon/pen/qyezvX
<pre id="output"></pre>
<script>
var n = prompt("Enter value of N", 5), c = 1, str = "";
for(i = 1; i<=n; i++) {
if(i % 2 === 0) c = 2;
else c = 1;
for(j = 1; j<=n; j++) {
if(c % 2 !== 0) str += "#";
@hakimzulkufli
hakimzulkufli / app.js
Last active January 5, 2023 04:34
Detect and Resolve layout files automatically like SvelteKit using Inertia.js (Laravel + Vite + Svelte)
import { createInertiaApp } from "@inertiajs/inertia-svelte";
import { InertiaProgress } from "@inertiajs/progress";
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers";
import DefaultLayout from "$/Pages/__layout.svelte";
const appName = window.document.getElementsByTagName("title")[0]?.innerText || "App Name";
const layouts = import.meta.glob('./Pages/**/__layout.svelte');
const pages = import.meta.glob('./Pages/**/*.svelte');
/**
// ==UserScript==
// @name No YouTube Volume Normalization
// @namespace https://gist.github.com/abec2304
// @match https://www.youtube.com/*
// @grant none
// @version 2.1
// @author abec2304
// @description Enjoy YouTube videos at their true volume
// @inject-into content
// @run-at document-start