Skip to content

Instantly share code, notes, and snippets.

View renanliberato's full-sized avatar
🎯

Renan Liberato Sant'Ana renanliberato

🎯
View GitHub Profile
const fs = require('fs')
const directory = './src/images';
const scriptFile = 'index.js';
if (fs.existsSync(`${directory}/${scriptFile}`))
fs.unlinkSync(`${directory}/${scriptFile}`);
const files = fs.readdirSync(directory);
fs.writeFileSync(`${directory}/${scriptFile}`, 'export const IMAGES = {\n');

Unistore Hooks for Preact

Experimental hooks-based bindings for Unistore. Available on npm:

npm i unistore-hooks

Note: this should also work with React, just alias "preact" and "preact/hooks" to "react" in your bundler.

Usage

@louis-e
louis-e / UDPSocket.cs
Last active April 14, 2024 02:43 — forked from darkguy2008/UDPSocket.cs
Simple C# UDP server/client in 62 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
{
public class UDPSocket
{
public Socket _socket;
@darkguy2008
darkguy2008 / UDPSocket.cs
Last active April 21, 2024 14:48
Simple C# UDP server/client in 56 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
{
public class UDPSocket
{
private Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version