Skip to content

Instantly share code, notes, and snippets.

@pastleo
pastleo / nm_l2tp_ipsec_vpn.md
Last active May 4, 2024 01:12
setup L2TP IPSEC VPN in archlinux using NetworkManager
@ynagatomo
ynagatomo / Extension+ModelComponent.swift
Created April 29, 2024 11:48
An extension of ModelComponent, to dump its MeshResource.Model such as positions and normals.
extension ModelComponent {
/// Dump the MeshResource.Model
func dumpMeshResourceModel() {
let printSIMD3Float = { (value: SIMD3<Float>) in
print("(\(value.x), \(value.y), \(value.z)), ", terminator: "")
}
let printSIMD2Float = { (value: SIMD2<Float>) in
print("(\(value.x), \(value.y)), ", terminator: "")
}
@matsen
matsen / svg2tiff
Created December 12, 2012 01:05
A script to convert SVG to a TIFF acceptable to PLOS
#!/bin/sh
# Convert all arguments (assumed SVG) to a TIFF acceptable to PLOS
# Requires Inkscape and ImageMagick 6.8 (doesn't work with 6.6.9)
for i in $@; do
BN=$(basename $i .svg)
inkscape --without-gui --export-png="$BN.png" --export-dpi 300 $i
convert -compress LZW -alpha remove $BN.png $BN.tiff
mogrify -alpha off $BN.tiff
// build: gcc amdgpustats.c -o amdgpustats `pkg-config --cflags --libs libdrm`
// Requires Linux 4.12 or later, and libdrm 2.4.77 or later
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
@adrianhajdin
adrianhajdin / .eslintrc.cjs
Last active May 4, 2024 01:06
Tailwind CSS Full Course 2023 | Build and Deploy a Nike Website
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
@VagnerSilva
VagnerSilva / NativeBaseProvider.tsx
Created August 7, 2023 19:16
Fix to NativeBaseProvider.tsx - In React 18, SSRProvider is not necessary and is a noop.
import { OverlayProvider } from '@react-native-aria/overlays';
import { SSRProvider } from '@react-native-aria/utils';
import { ToastProvider, ToastRef, useToast } from 'native-base/src/components/composites/Toast';
import React from 'react';
import { Platform, useWindowDimensions } from 'react-native';
import {
Metrics,
SafeAreaProvider,
initialWindowMetrics as defaultInitialWindowMetrics,
} from 'react-native-safe-area-context';
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@christianparpart
christianparpart / terminal-synchronized-output.md
Last active May 4, 2024 01:00
Terminal Spec: Synchronized Output

Synchronized Output

Synchronized output is merely implementing the feature as inspired by iTerm2 synchronized output, except that it's not using the rare DCS but rather the well known SM ? and RM ?. iTerm2 has now also adopted to use the new syntax instead of using DCS.

Semantics

When rendering the screen of the terminal, the Emulator usually iterates through each visible grid cell and renders its current state. With applications updating the screen a at higher frequency this can cause tearing.

This mode attempts to mitigate that.

@NathanWalker
NathanWalker / ns-if.directive.ts
Last active May 4, 2024 01:00
nsIf - Specialized NativeScript directive for Angular to optimize view show/hide with change detection under mobile constraints
import {
Directive,
ElementRef,
EmbeddedViewRef,
Input,
OnDestroy,
OnInit,
Optional,
TemplateRef,
ViewContainerRef,