Skip to content

Instantly share code, notes, and snippets.

View devmnj's full-sized avatar
💭
Exploring Algos

Manoj AP devmnj

💭
Exploring Algos
View GitHub Profile
@devmnj
devmnj / index.html
Created November 1, 2022 04:12
Material Design Preloader
<header>
<div aria-busy="true" aria-label="Loading, please wait." role="progressbar"></div>
</header>
<main role="main">
<img src="https://www.google.com/inbox/assets/images/intro/intro-logo.png" width="100" alt="" />
<h1>Material Design Preloader</h1>
<p>A CSS only solution that recreates the Material Design preloader; or, who needs jQuery anyway?</p>
<p>You should set <code>aria-busy</code> to <code>false</code> when your stuff is loaded.
</main>
@devmnj
devmnj / css-gears.markdown
Created November 1, 2022 04:11
CSS Gears

CSS Gears

I made these for my new portfolio site. You might be able to use this as a loading animation or something like that. I had this demo up here before but I think codepen ate it. They do look pretty tasty.

Forked from Alex Tebbs's Pen CSS Gears.

A Pen by Karafizi Arthur on CodePen.

License.

@devmnj
devmnj / App.svelte
Created October 31, 2022 11:58
Styling inner tag in @htm - Svelte
<div class=" mb-1 text-lg">
<style>
a:hover {
color: orange;
}
</style>
{@html html}
</div>
@devmnj
devmnj / analytic.svelte
Last active October 31, 2022 11:56
Svelete Analytic Component
Place the component in +layout.svelte
<script lang="ts">
import { page } from '$app/stores'
$: {
if (typeof gtag !== 'undefined') {
gtag('config', 'MEASUREMENT_ID', {
page_title: document.title,
page_path: $page.url.pathname,
})
@devmnj
devmnj / Banner.svelte
Created October 31, 2022 10:02
Svelte Twind Banner Component
<div class="container my-10 mx-auto">
<!-- Section: Design Block -->
<section class="">
<div class="bg-slate-600 alert alert-dismissible fade show fixed top-0 right-0 left-0 z-[1030] w-full py-2 px-6 text-white md:flex justify-between items-center text-center md:text-left">
<div class="mb-1 md:mb-0 flex items-center flex-wrap justify-center md:justify-start">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" class="w-4 h-4 mr-2">
<!-- Font Awesome Pro 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) -->
<path fill="currentColor"
d="M216 23.86c0-23.8-30.65-32.77-44.15-13.04C48 191.85 224 200 224 288c0 35.63-29.11 64.46-64.85 63.99-35.17-.45-63.15-29.77-63.15-64.94v-85.51c0-21.7-26.47-32.23-41.43-16.5C27.8 213.16 0 261.33 0 320c0 105.87 86.13 192 192 192s192-86.13 192-192c0-170.29-168-193-168-296.14z" />
@devmnj
devmnj / App.svelte
Created October 31, 2022 07:43
Styling inner tags in (@html in) Svelte
<script>
let name = '<b>w</b>orld';
</script>
<h1>Hello {@html name}!</h1>
<style>
:global(b){
color:blue;
}
</style>
@devmnj
devmnj / richtext.jsx
Created October 22, 2022 14:31
React contentful RichText rendering component
import { documentToReactComponents } from "@contentful/rich-text-react-renderer";
import { BLOCKS } from "@contentful/rich-text-types";
const renderDocument = (document) => {
const Text = ({ children }) => <p>{children}</p>;
const options = {
renderNode: {
[BLOCKS.PARAGRAPH]: (node, children) => <Text>{children}</Text>
},
renderText: (text) =>
@devmnj
devmnj / cText.cs
Created October 19, 2022 03:36
C# custom search box control library with textbox and list boxt control - Win Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@devmnj
devmnj / placeboxes.cs
Created September 26, 2022 04:54
How to place textboxes and other control on Datagridview - C#.Net
try
{
int r_left = 0, r_top = 0;
DataGridViewCell cell;
cell = row.Cells[colLno.Index];
r_left = dataGridView1.GetCellDisplayRectangle(cell.ColumnIndex, cell.RowIndex, false).Left;
r_top = dataGridView1.GetCellDisplayRectangle(cell.ColumnIndex, cell.RowIndex, false).Top;
@devmnj
devmnj / connection string
Created September 25, 2022 05:34
MSQL connection string for Windows authentication
<connectionStrings>
<add name="MyConnection"
connectionString="Data Source=LAPTOP-J3H2M20O;Initial Catalog=mydatabase;Integrated Security=True"/>
</connectionStrings>