Skip to content

Instantly share code, notes, and snippets.

View pc223's full-sized avatar
👋
Hello! 👋

pc223 pc223

👋
Hello! 👋
View GitHub Profile
@feltmax
feltmax / convert.py
Last active May 9, 2024 16:46
ttf2png (convert ttf font files to png images)
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2023 feltmax
# Released under the MIT license
# https://opensource.org/licenses/mit-license.php
# reference:
# http://stackoverflow.com/questions/4458696/finding-out-what-characters-a-font-supports
@ppartarr
ppartarr / archdualboot.md
Last active July 9, 2024 20:45
Comprehensive guide to dual boot arch & windows

Dual booting Arch linux & Windows 10

There are already dozens of tutorials to setup an Arch and Windows dual boot - welcome to a dozen + 1. Like most others this is a step by step guide. Unlike most others the steps are ordered in a way that makes sense (starting with the download first - duh!) so you won't have to restart your computer a gazillion times.

I did this on a single SSD Dell XPS 15 with windows 10 preinstalled. It's obviously possible to follow this guide if you're installing Arch onto a different drive or if you're running older hardware. If you run into any problems please be sure to read through the Arch Installation Guide and the Arch Dual boot with Windows wiki.

To get started you will need:

  • a stable internet connection
  • a USB key with 1GB storage
  • a cup of coffee & and a can do attitude
@machinekoder
machinekoder / fix_rosinstall.py
Created February 7, 2019 09:34
Fix .rosinstall file for the time the GitHub is around (see https://github.com/vcstools/vcstools/issues/147)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import shutil
import sys
import tarfile
import tempfile
from sh import wget
import os
import yaml
@h0bbel
h0bbel / sources.list
Last active June 29, 2024 11:13
/etc/apt/sources.list for Ubuntu 18.04.1 LTS Bionic Beaver
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
@danjargold
danjargold / whatFilesHaveIShared.gs
Created August 11, 2018 09:31
Google script to list (on a Google Sheet) all files shared in your google drive, including all viewers, editors, and sharing permissions. Credit goes to @woodwardtw (https://gist.github.com/woodwardtw/22a199ecca73ff15a0eb) as this is an improvement on his code which only assesses a single folder and one level of sub-folders down.
function listFolders(folder) {
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow(["Name", "Sharing Access", "Sharing Permission", "Get Editors", "Get Viewers", "Date", "Size", "URL", "Download", "Description", "Type"]); //writes the headers
//var folder = DriveApp.getFolderById("INSERT_YOUR_FILE_ID");//that long chunk of random numbers/letters in the URL when you navigate to the folder
//getLooseFiles(folder, sheet);
//getSubFolders(folder, sheet);
//instead of getting folder by ID rather get all folders and cycle through each. Note this will miss loose files in parent directory.
var folder = DriveApp.getFolders()
@soruly
soruly / compre.py
Last active June 15, 2023 14:38
Compare two images using OpenCV and SIFT in python
import cv2
import sys
import os.path
import numpy as np
def drawMatches(img1, kp1, img2, kp2, matches):
rows1 = img1.shape[0]
cols1 = img1.shape[1]
rows2 = img2.shape[0]
@J2TEAM
J2TEAM / remove_accents.py
Created August 31, 2016 17:11 — forked from cinoss/remove_accents.py
Remove Vietnamese Accents - Xoá dấu tiếng việt in Python
s1 = u'ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯưẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ'
s0 = u'AAAAEEEIIOOOOUUYaaaaeeeiioooouuyAaDdIiUuOoUuAaAaAaAaAaAaAaAaAaAaAaAaEeEeEeEeEeEeEeEeIiIiOoOoOoOoOoOoOoOoOoOoOoOoUuUuUuUuUuUuUuYyYyYyYy'
def remove_accents(input_str):
s = ''
print input_str.encode('utf-8')
for c in input_str:
if c in s1:
s += s0[s1.index(c)]
else:
s += c
@CMCDragonkai
CMCDragonkai / ordering_of_x_startup_scripts.md
Last active January 31, 2023 14:46
NixOS: Ordering of X Startup Scripts

Ordering of X Startup Scripts

This is specific to NixOS.

There are 2 cases, the text mode case, and the graphical mode case. This is the graphical mode case:

  1. Bootup (systemd services)
  2. Runs systemctl start display-manager either automatically or via terminal.
@Ashton-W
Ashton-W / Issue.md
Last active June 14, 2024 15:27
GitHub Markdown toggle code block
Click to toggle contents of `code`
CODE!
@edolstra
edolstra / nix-ui.md
Last active July 14, 2024 21:22
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.