Skip to content

Instantly share code, notes, and snippets.

@SergLam
SergLam / CountingLabel.swift
Created January 11, 2021 22:01
Animated counting UILabel for iOS in Swift
// Source - https://medium.com/@topLayoutGuide/swift-3-so-i-wanted-to-animate-a-label-14dd2b332ef9
//
// https://github.com/dataxpress/UICountingLabel/
//
import UIKit
enum CountingMethod {
case easeInOut
case easeIn
@infomiho
infomiho / 0-README.md
Last active April 25, 2024 14:43
Using ShadCN with Wasp 0.12+

Using ShadCN with Wasp 0.12 and beyond

Note

We'll be loosly following the Vite instructions for ShadCN since Wasp is using Vite + React: https://ui.shadcn.com/docs/installation/vite We'll skip some of the steps since they don't apply or they are done differently with Wasp.

We'll skip the @ alias setup since it's not currently supported by Wasp. Because of this you'll need to adjust some imports when we generate components, but it should be fairly straightforward to do.

1. Enable TailwindCSS if you haven't already

@Cr4sh
Cr4sh / ami_smi_dump.py
Last active April 25, 2024 14:40
Extract SW SMI handlers information from SMRAM dump of Skylake based AMI Aptio V firmware
'''
###########################################################################
Extract SW SMI handlers information from SMRAM dump of Skylake based
AMI Aptio V firmware.
To use full capabilities of this tool you need to install UEFIDump
(https://github.com/LongSoft/UEFITool/releases/tag/A32), ida-efiutils
(https://github.com/snare/ida-efiutils) and edit corresponding variables
below.
@jlucaspains
jlucaspains / app-gateway-identity.bicep
Last active April 25, 2024 14:40
Bicep to deploy application gateway and its required components for an externally visible Web App
@description('App Service location. Default is the location of the resource group.')
param location string = resourceGroup().location
@description('App base name')
param appBaseName string = 'myapp'
@description('Environment Name.')
param envName string = 'dev'
var applicationGateWayName = 'apgw-${appBaseName}-${envName}-${location}-001'
@mattiasghodsian
mattiasghodsian / readme.md
Last active April 25, 2024 14:39
Valheim Dedicated Server Setup on Ubuntu 20.04.1 LTS

Port forwarding

Open ports (udp)

2456 2457 2458 27060

Uncomplicated Firewall

sudo ufw allow 2456/udp
@jctosta
jctosta / screen_cheatsheet.markdown
Last active April 25, 2024 14:39
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@WajihaAd
WajihaAd / gist:c9d117fea0cdb072d959f0875c6ff7d2
Last active April 25, 2024 14:40
C++ game: "Simulate a game where teams randomly generate players and take turns hitting each other, with the final result determined by the number of hits."
#include <iostream>
#include <stdlib.h> // for rand
using namespace std;
class Team {
private:
static int count;
static int count1;
public:
@fransr
fransr / bucket-disclose.sh
Last active April 25, 2024 14:38
Using error messages to decloak an S3 bucket. Uses soap, unicode, post, multipart, streaming and index listing as ways of figure it out. You do need a valid aws-key (never the secret) to properly get the error messages
#!/bin/bash
# Written by Frans Rosén (twitter.com/fransrosen)
_debug="$2" #turn on debug
_timeout="20"
#you need a valid key, since the errors happens after it validates that the key exist. we do not need the secret key, only access key
_aws_key="AKIA..."
H_ACCEPT="accept-language: en-US,en;q=0.9,sv;q=0.8,zh-TW;q=0.7,zh;q=0.6,fi;q=0.5,it;q=0.4,de;q=0.3"
H_AGENT="user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36"
@dhh
dhh / linux-setup.sh
Last active April 25, 2024 14:37
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils