Skip to content

Instantly share code, notes, and snippets.

@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@tuto1902
tuto1902 / chatbox.blade.php
Last active May 10, 2024 08:19
Livewire Chat Box Component
<?php
use App\Events\MessageSent;
use Livewire\Volt\Component;
new class extends Component
{
/**
* @var string[]
*/
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
name: test
spec:
replicas: 1
template:
metadata:
creationTimestamp: null
import * as React from 'react';
import { DateTime } from 'luxon';
import { Calendar as CalendarIcon } from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Calendar } from '@/components/ui/Calendar';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/Popover';
import { cn } from '@/lib/utils';
import { SelectSingleEventHandler } from 'react-day-picker';
import { Label } from '@/components/ui/Label';
@mcandre
mcandre / elecraft-kx3-cheatsheet.md
Last active May 10, 2024 08:17
Elecraft KX3 Cheatsheet

Elecraft KX3 Cheatsheet

The KX3 transceiver is designed for HF amateur band operation. The KX3 natively supports 160m - 6m.

An optional 2m accessory can extend the band support to 2m, though the installation of that accessory is a more intensive, electronics hobbyist task.

WARNINGS

As with all radios, do not transmit when the antenna is disconnected. Avoid touching the antenna or feed line when transmitting. Power down the radio and disconnect the feed line when making antenna adjustments.

@straker
straker / README.md
Last active May 10, 2024 08:17
Basic Bomberman HTML and JavaScript Game

Basic Bomberman HTML and JavaScript Game

This is a basic implementation of the NES game Bomberman, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Player death
  • The player should die when it is hit by an explosion from a bomb
@r2k0
r2k0 / sed_snippets.sh
Last active May 10, 2024 08:11
sed examples
##FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
# triple space a file
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 10, 2024 08:07
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@WillSams
WillSams / m68k_dev_setup.sh
Last active May 10, 2024 08:10
Setup for Motorola 68000 (Sega, Neo Geo) Cross Compiler on Debian-based System
#!/bin/bash
echo "==================================================================="
echo
echo " My m68000 Development Setup "
echo " You may be prompted for root credentials to complete the install. "
echo
echo " Toolchain is GNU so it expects you to write AT&T style assembly. "
echo " If you want the Windows (MSYS2) script, it's here: "
echo " https://gist.github.com/WillSams/f592f9d494b51119945440f7e91079b0 "