Skip to content

Instantly share code, notes, and snippets.

@vicasas
vicasas / .eslintignore
Created October 28, 2021 12:10
Next.js Lint with Eslint + Airbnb Style + Husky + Lint-Staged
.next
public
node_modules
yarn.lock
package-lock.json
**/*.test.js
coverage
@nicolasdao
nicolasdao / open_source_licenses.md
Last active April 19, 2024 19:12
What you need to know to choose an open source license.
@secsilm
secsilm / str_count.py
Created March 25, 2017 14:04
使用 Python 统计字符串中英文、空格、数字、标点个数
# coding: utf-8
import string
from collections import namedtuple
def str_count(s):
'''找出字符串中的中英文、空格、数字、标点符号个数'''
count_en = count_dg = count_sp = count_zh = count_pu = 0
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@wareya
wareya / spi_recorder.ino
Last active April 19, 2024 19:01
long SPI message recorder - rasberry pi pico (rp2040), arduino IDE .ino file (C++)
// wiring example for ripping a PMW3360 SROM: https://i.imgur.com/EspAlvz.jpeg
// set the board to 240mhz or higher for best results (WARNING: higher than 240mhz only works with USB if you overvolt the MCU)
// this implements reading SPI mode 3. if you want a different mode, you need to edit these two lines:
// uint32_t clockval = (1 << pin_clock);
// if (newclock && !clockval && buff_i < buffsize)
#include <pico/stdlib.h>
#define buffsize 50000
@sergomet
sergomet / GoogleDriveServiceProvider.php
Created April 1, 2017 07:01 — forked from ivanvermeyen/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
@lucaspar
lucaspar / nvenc-install.sh
Last active April 19, 2024 19:00
Installation script of CUDA-accelerated `ffmpeg` with NVIDIA Encoder
#!/bin/bash
# =========================================================================
# Source: https://gist.github.com/lucaspar/27f5e108b80524b315be10b2a9049817
# =========================================================================
# This script will compile and install a static FFmpeg build with
# support for NVENC in Ubuntu. Developed in Ubuntu 23.10,
# with NVIDIA Drivers v535.129.03 and CUDA v12.2 with a GPU
# with CUDA capability 8.6 (RTX 3080) (see ccap below).
# It assumes NVIDA drivers are installed and that you have a
# CUDA-compatible GPU. You can check installed drivers with:
@ChuckMichael
ChuckMichael / vcredistr.md
Last active April 19, 2024 18:55
Visual C++ Redistributable Packages
@timfee
timfee / timezones.ts
Last active April 19, 2024 18:51
Friendly Timezones
type TimeZoneInfo = {
friendlyName: string
offsetString: string
offsetNumeric: number
longTimezones: string[]
}
function offsetStringToNumeric(offsetString: string): number {
const sign = offsetString.startsWith("GMT-") ? -1 : 1
const [hours, minutes] = offsetString.slice(4).split(":").map(Number)
@staltz
staltz / introrx.md
Last active April 19, 2024 18:49
The introduction to Reactive Programming you've been missing