Skip to content

Instantly share code, notes, and snippets.

View naufaldi's full-sized avatar
🏘️
Remote Worker

Naufaldi naufaldi

🏘️
Remote Worker
View GitHub Profile
@bessfernandez
bessfernandez / setting-up-html-storybook-app.md
Last active March 28, 2023 16:37
How to setup a simple Storybook HTML demo app

icon-storybook-default

Storybook for HTML

Storybook is all about writing stories. A story usually contains a single state of one component, almost like a visual test case.

Typically you see Storybook used for React or other frameworks, but the library has recently introduced the option to use HTML for your Storybook projects. As a prototyping tool or playground this is great! No larger scale knowledge of other frameworks needed.

Install Storybook HTML

@gaearon
gaearon / uselayouteffect-ssr.md
Last active May 2, 2024 13:42
useLayoutEffect and server rendering

If you use server rendering, keep in mind that neither useLayoutEffect nor useEffect can run until the JavaScript is downloaded.

You might see a warning if you try to useLayoutEffect on the server. Here's two common ways to fix it.

Option 1: Convert to useEffect

If this effect isn't important for first render (i.e. if the UI still looks valid before it runs), then useEffect instead.

function MyComponent() {
@justsml
justsml / fetch-api-examples.md
Last active February 24, 2024 18:05
JavaScript Fetch API Examples
@melihmucuk
melihmucuk / home.js
Created August 29, 2016 23:17
react native animate listview rows while scrolling
import React, { Component } from 'react';
import {
StyleSheet,
View,
Text,
ListView
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import * as Animatable from 'react-native-animatable';
@ianmustafa
ianmustafa / readme.md
Last active September 26, 2020 00:44
Konfigurasi Sublime Text 3 Favorit. Dikumpulkan dengan penuh ❤︎ oleh Ian Mustafa.

Konfigurasi Sublime Text 3 Favorit

Dikumpulkan dengan penuh ❤︎︎ oleh Ian Mustafa.

Konfigurasi

Bisa diakses melalui Ctrl+Shift+P (atau +Shift+P di Mac).

{
@didats
didats / Nginx configuration file
Last active May 2, 2016 12:42
Add login capability on crud admin
server {
listen 80;
server_name example.com;
root /usr/share/nginx/example.com/web;
index index.php index.html;
location ~* ^/(assets|files|robots\.txt) { }
location / {
if (-f $request_filename) {
@chrisveness
chrisveness / index.html
Last active January 3, 2023 06:50
JavaScript AES client/server interoperability test
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AES client/server test</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css">
<style>
body { font-size: 80%; padding: 1em; }
form { margin-top: 2em; }
label { display: inline-block; width: 6em; }
@danielwrobert
danielwrobert / webpack.config.js
Last active February 1, 2022 10:18
Example Webpack Config File
const path = require( 'path' );
const webpack = require( 'webpack' );
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = ( env, options ) => {
return {
entry: './src/block.js',
output: {
path: path.resolve( __dirname, 'build' ),
@glueckpress
glueckpress / px-rem-cheat-sheet.css
Created May 26, 2013 16:17
Cheat sheet for rem-calculations based upon 14px and 16px.
/*! = $rembase: 14px
--------------------------------------------------------------
* hmtl { font-size: 87.5%; }
* body { font-size: 14px; font-size: 1rem; line-height: 1; }
* 4px 0.28571429rem
* 8px 0.571428571rem
* 12px 0.857142857rem
* 13px 0.928571429rem
* 14px 1rem
* 16px 1.142857143rem