Skip to content

Instantly share code, notes, and snippets.

@yyk
yyk / gist:9735d4df2b3c7dd0ea0d35affbb8c77e
Created August 4, 2022 19:12
checkout with ncurses
from curses import wrapper
import curses
from git import Repo
def main(stdscr, path):
repo = Repo(path)
branches = list(repo.branches)
branches.sort(key=lambda x: x.commit.committed_date, reverse=True)
branches = branches[:min(len(branches), curses.LINES - 1)]
current = repo.active_branch
@yyk
yyk / test.sql
Created December 14, 2012 11:50
ALTER TABLE `rate3`.`algorithm` DROP COLUMN `user_uuid` ; CREATE TABLE `rate3`.`user_algorithm` ( `user_uuid` BINARY(16) NOT NULL , `algorithm_uuid` BINARY(16) NOT NULL , PRIMARY KEY (`user_uuid`, `algorithm_uuid`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;
-- MySQL dump 10.13 Distrib 5.5.28, for Win32 (x86)
--
-- Host: localhost Database: rate3
-- ------------------------------------------------------
-- Server version 5.5.28
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;