Skip to content

Instantly share code, notes, and snippets.

View madhawa-se's full-sized avatar
😃
hmm

madhawa priyashantha madhawa-se

😃
hmm
  • mad-logic
  • srilanka
View GitHub Profile
@tkrotoff
tkrotoff / CSSFrameworks.md
Last active March 18, 2024 04:26
CSS Frameworks (Bootstrap, Tailwind CSS, Bulma, React Bootstrap, Chakra UI, Ant Design)

The right question is: is there added value in reinventing the wheel? (button, form controls, badge, card, spinner, modal...). The existing wheels will probably ride better than yours.

I would go with vanilla Bootstrap (just the Sass part, not the JS part).

Bootstrap

Bootstrap CSS utilities are very nice: same principles as Tailwind CSS.

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@Andrious
Andrious / gridview_sample.dart
Created December 3, 2019 00:53
GridView Sample from the documentation.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
@divyanshub024
divyanshub024 / wave_anim.dart
Last active November 18, 2020 01:35
Flutter Circular Wave Canvas Animation
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@ZeVS777
ZeVS777 / Mesh.cpp
Last active June 10, 2023 13:46
Udemy - Computer Graphics with Modern OpenGL and C++ / code files after 02 - Beginner 016 CODING Clean Up
#include "Mesh.h"
Mesh::Mesh()
{
VAO = 0, VBO = 0, IBO = 0, indexCount = 0;
}
void Mesh::CreateMesh(GLfloat* vertices, unsigned int* indices, unsigned int numOfVertices, unsigned int numOfIndices)
{
indexCount = numOfIndices;
ElementHandle {
_context:
ExecutionContext {
_client:
CDPSession {
_events: [Object],
_eventsCount: 27,
_maxListeners: undefined,
_callbacks: Map {},
_connection: [Connection],
@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@bradsiefert
bradsiefert / bootstrap4-8pt-grid-system.scss
Last active January 7, 2023 13:55
Updating the Bootstrap 4 Grid System to an 8pt Grid
// Update to 8pt Grid System
$grid-gutter-width: 32px !default;
$container-max-widths: (sm: 480px, md: 736px, lg: 992px, xl: 1200px) !default;
$grid-breakpoints: (xs: 0, sm: 512px, md: 768px, lg: 1024px, xl: 1200px ) !default;
# Read the file and get the DNA string
file = open('sample_dna.txt', 'r')
dna = file.read()
print "DNA Sequence: ", dna
# DNA codon table
protein = {"TTT" : "F", "CTT" : "L", "ATT" : "I", "GTT" : "V",
"TTC" : "F", "CTC" : "L", "ATC" : "I", "GTC" : "V",
"TTA" : "L", "CTA" : "L", "ATA" : "I", "GTA" : "V",
@DariuszLuber
DariuszLuber / Webpack config for Sass+ES6+LiveReload.md
Last active July 29, 2022 10:10
Webpack + ES6 + Sass + Live reload

#Webpack + ES6 + Sass + Live reload

Basic example of webpack config to work with sass, es6 and live reload.

To get live reload working you need:

  • get package.json and webpack.config.js to your project foldee
  • run in terminal npm install
  • add this script <script src="http://localhost:35729/livereload.js"></script> to your index.html
  • create src folder and src files
  • run in terminal webpack