Skip to content

Instantly share code, notes, and snippets.

@bolubee101
bolubee101 / migration.sql
Last active February 26, 2025 08:12
PostgreSQL Schema and Data Migration Script Using the dblink extension
DO $$
DECLARE
tbl RECORD;
col RECORD;
seq RECORD;
udt RECORD;
schema RECORD;
sql TEXT;
default_expr TEXT;
column_definitions TEXT;
@billhhh
billhhh / arraybuffer.py
Created April 15, 2019 03:03 — forked from akhilman/arraybuffer.py
numpy array buffer which acts as deque
import enum
import logging
import unittest
import numpy as np
class Side(enum.IntEnum):
NONE = 0
LEFT = 1
@wizioo
wizioo / gitignore_per_git_branch.md
Last active October 10, 2025 18:54
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.

@axefrog
axefrog / 0.suffixtree.cs
Last active July 12, 2023 01:01
C# Suffix tree implementation based on Ukkonen's algorithm. Full explanation here: http://stackoverflow.com/questions/9452701/ukkonens-suffix-tree-algorithm-in-plain-english
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace SuffixTreeAlgorithm
{
public class SuffixTree
{