Skip to content

Instantly share code, notes, and snippets.

@fnky
fnky / ANSI.md
Last active May 8, 2024 15:42
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@carousel
carousel / snake-to-camel.php
Last active May 8, 2024 15:42
Convert snake to camel case and back with PHP
<?php
function camel_to_snake($input)
{
return strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $input));
}
function snakeToCamel($input)
{
return lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $input))));
}
@kisabelle
kisabelle / acf-pagination.php
Last active May 8, 2024 15:41
ACF Repeater Field Pagination
<?php
/*
* Paginate Advanced Custom Field repeater
*/
if( get_query_var('page') ) {
$page = get_query_var( 'page' );
} else {
$page = 1;
}
sudo apt update -y
sudo apt upgrade -y
sudo snap install code --classic
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install gcc g++ make
@ryanfitz
ryanfitz / golang-nuts.go
Created December 2, 2012 22:45
two ways to call a function every 2 seconds
package main
import (
"fmt"
"time"
)
// Suggestions from golang-nuts
// http://play.golang.org/p/Ctg3_AQisl
@lukicdarkoo
lukicdarkoo / egpu.bash
Last active May 8, 2024 15:37
Computer Vision with NVIDIA eGPU Configuration
# This script prepares your machine for computer vision challenges (with NVIDIA).
# Tested with Ubuntu 20.04 LTS and NVIDIA GeForce GTX 1070 (Aorus Gaming Box enclosure).
# Reddit post: https://www.reddit.com/r/eGPU/comments/io94qq/linux_aorus_gaming_box_for_robotics_and_computer/
#
# The script does the following:
# * Installs NVIDIA driver
# * Installs NVIDIA CUDA Toolkit (`nvcc`)
# * Installs NVIDIA CUDA Deep Neural Network library (cuDNN)
# * Installs OpenCV with CUDA support (WIP)
# * Installs TensorFlow with CUDA support
@AlmogBaku
AlmogBaku / bitly.go
Last active May 8, 2024 15:36
Golang Bitly: simple, stupid shortener written in go
package bitly
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
const BaseURL = "https://api-ssl.bitly.com/v4"

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
@seajaysec
seajaysec / customqueries.json
Last active May 8, 2024 15:35
bloodhound custom queries
{
"queries": [{
"name": "List all owned users",
"queryList": [{
"final": true,
"query": "MATCH (m:User) WHERE m.owned=TRUE RETURN m"
}]
},
{
"name": "List all owned computers",
@thegreatestminer
thegreatestminer / encoded-20201212150102.txt
Created December 12, 2020 15:01
MobaXTerm Professional x64 License Key [READ COMMENTS]
UEsDBBQAAAAIABNQjFGCf/GfLgAAACwAAAAHAAAAUHJvLmtleTMqdncpCXQOKDAp9woMzEo1MTVOrHAzTjTLME7VNs1LK8owTjQpcU8tcuLlAgBQSwECFAAUAAAACAATUIxRgn/xny4AAAAsAAAABwAAAAAAAAAAAAAAAAAAAAAAUHJvLmtleVBLBQYAAAAAAQABADUAAABTAAAAAAA=