Skip to content

Instantly share code, notes, and snippets.

@rrafal
rrafal / sqlx_json.go
Created March 31, 2016 00:02
Use JSON field with golang sqlx driver
package main
import (
"encoding/json"
"errors"
"database/sql/driver"
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
"log"
@endofunky
endofunky / service.macchanger.nix
Created July 5, 2021 19:56
macchanger/systemd for NixOS
{ config, lib, pkgs, ...}:
with lib;
let
cfg = config.sec.macchanger;
in {
options = {
sec.macchanger = {
enable = mkOption {
@baymaxium
baymaxium / content.md
Created October 18, 2017 08:31
如何阅读一份代码?

原文:程序人生

上文谈到了像读书一样阅读源码的重要性,今天谈谈如何阅读一份代码。我所谓的一份代码,其范围可能从几千行到数万行,有时甚至可多达数十万行。这些代码作为一个有机体,共同完成某些重要的功能。比如说几个著名的 full fledged web framework,祖师爷 rails,师叔 django 和小师妹 phoenix:

import time
import requests
import logging
import boto3
from botocore.config import Config
def send_price_data_to_timestream(write_client):
base_url = "https://min-api.cryptocompare.com/data"
symbols = "BTC,ETH,REP,DASH"
@fnky
fnky / ANSI.md
Last active December 28, 2024 01:30
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@zhuowei
zhuowei / reachable_services.txt
Created February 21, 2023 06:26
Reachable Mach services from the app sandbox on iOS 16.1
PurpleSystemAppPort
PurpleSystemEventPort
UIASTNotificationCenter
com.apple.ABDatabaseDoctor
com.apple.AppSSO.service-xpc
com.apple.AuthenticationServicesCore.AuthenticationServicesAgent
com.apple.CARenderServer
com.apple.ClipServices.clipserviced
com.apple.CoreAuthentication.daemon
com.apple.DeviceAccess.xpc
@Pymmdrza
Pymmdrza / transfer_model.py
Created December 28, 2024 01:27
Backup tools for any website and server create and compress with upload data to ftp, sftp , s3 and r2 with python
# --------------------------------------
# Programmer : github.com/PyMmdrza
# pip install tqdm ftplib boto3 pysftp
# --------------------------------------
import ftplib
import pysftp
import boto3
import tarfile
import zipfile
import os
<svg width="300" height="300" viewBox="0 0 300 300">
<defs>
<filter id="paperEffect">
<feTurbulence
type="fractalNoise"
baseFrequency="0.04"
numOctaves="5"
result="noise"
/>
<feDiffuseLighting
@davidteren
davidteren / Rails, Puma & Nginx.md
Last active December 28, 2024 01:17
Example setup for Puma with Nginx in a Rails app

In the apps config/puma.rb file:

Change to match your CPU core count
# Check using this on the server => grep -c processor /proc/cpuinfo
workers 4

# Min and Max threads per worker
threads 1, 6

app_dir = File.expand_path('../..', FILE)