Skip to content

Instantly share code, notes, and snippets.

@paulyc
paulyc / list27.txt
Created December 19, 2020 21:24 — forked from anonymous/list27.txt
000(023Rb|001Rb)
001(017La|002Rb)
002(021La|003Rb)
003(021La|004La)
004(009Rb|005Lb)
005(004Ra|005La)
006(008La|007La)
007(009Rb|007La)
008(009Ra|008La)
009(010Ra|026Ra)
@paulyc
paulyc / PrintBootCampESDInfo.swift
Created May 25, 2020 00:56 — forked from nuomi1/PrintBootCampESDInfo.swift
macOS and BootCamp Latest
#!/usr/bin/env swift
//
// REPL.swift
//
// Created by nuomi1 on 8/5/18.
// Copyright © 2018年 nuomi1. All rights reserved.
//
import Foundation
@paulyc
paulyc / broadcom-wl-dkms.sh
Created February 10, 2020 18:41 — forked from stevenmirabito/broadcom-wl-dkms.sh
Installs the broadcom-wl kernel module with DKMS
#!/bin/bash
# Installs the broadcom-wl kernel module with DKMS
# Tested under Fedora 23, will likely work with other versions/distros
# Author: Steven Mirabito <smirabito@csh.rit.edu>
# Create a work directory
mkdir -p /tmp/broadcom
cd /tmp/broadcom
# Download the module from Broadcom (http://www.broadcom.com/support/?gid=1)
@paulyc
paulyc / broadcom-wl-dkms.sh
Created February 10, 2020 18:41 — forked from stevenmirabito/broadcom-wl-dkms.sh
Installs the broadcom-wl kernel module with DKMS
#!/bin/bash
# Installs the broadcom-wl kernel module with DKMS
# Tested under Fedora 23, will likely work with other versions/distros
# Author: Steven Mirabito <smirabito@csh.rit.edu>
# Create a work directory
mkdir -p /tmp/broadcom
cd /tmp/broadcom
# Download the module from Broadcom (http://www.broadcom.com/support/?gid=1)
@paulyc
paulyc / star-trek-all.tsv
Created February 9, 2020 14:50 — forked from mislav/star-trek-all.tsv
List of Star Trek: The Original Series episodes ranked by their meta-score aggregated from several sites
S-EP episode title score
1-01 The Man Trap -33
1-02 Charlie X 26
1-03 Where No Man Has Gone Before 34
1-04 The Naked Time 64
1-05 The Enemy Within 30
1-06 Mudd's Women -31
1-07 What Are Little Girls Made Of? -1
1-08 Miri -30
1-09 Dagger of the Mind 8
@paulyc
paulyc / bcm57765or57785fix
Created February 8, 2020 23:41 — forked from samgooi4189/bcm57765or57785fix
Fixing Broadcom Corporation BCM57765/57785 SDXC/MMC Card Reader
Follow the WORKAROUND:
1. Add a comand to /etc/rc.local, add the following line above "exit 0":
setpci -s 00:1c.2 0x50.B=0x41
2. Add the same comand to /etc/apm/resume.d/21aspm (which does not exist yet):
setpci -s 00:1c.2 0x50.B=0x41
3. Add the following to /etc/modprobe.d/sdhci.conf:
options sdhci debug_quirks2=4
4. Re-generate initrd:
sudo update-initramfs -u -k all
5. Reboot or reload sdhci module:
@paulyc
paulyc / GraphicGlDemoActivity.java
Created February 3, 2020 17:46 — forked from ybakos/GraphicGlDemoActivity.java
A simple example of using an Android Renderer to illustrate OpenGL ES boilerplate.
/* GraphicGlDemoActivity.java
* Author: Yong Bakos
* Since: 11/26/2012
* Thanks to:
* Cube: http://intransitione.com/blog/create-a-spinning-cube-with-opengl-es-and-android/
* OpenGL Boilerplate: http://www.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/
*/
package com.humanoriented.sudoku;
import java.nio.ByteBuffer;
@paulyc
paulyc / NYXAVCEncoder.swift
Created January 28, 2020 03:00 — forked from Nyx0uf/NYXAVCEncoder.swift
Hardware accelerated GIF to MP4 converter in Swift using VideoToolbox
import VideoToolbox
import AVFoundation
private var __canHWAVC: Bool = false
private var __tokenHWAVC: dispatch_once_t = 0
public protocol NYXAVCEncoderDelegate : class
{
func didEncodeFrame(frame: CMSampleBuffer)
func didFailToEncodeFrame()
@paulyc
paulyc / gist:ecd4fbf6d4074aca185f0849081f544f
Created January 13, 2020 15:00 — forked from chriswhong/gist:762ceac7fb8a1420e7e7adceb770b707
Using ST_AsMVT() and ST_AsMVTGeom() in express to build a vector tile endpoint
/* GET /tiles/:z/:x/:y.mvt */
/* Retreive a vector tile by tileid */
router.get('/tiles/:z/:x/:y.mvt', async (req, res) => {
const { z, x, y } = req.params;
// calculate the bounding polygon for this tile
const bbox = mercator.bbox(x, y, z, false);
// Query the database, using ST_AsMVTGeom() to clip the geometries
// Wrap the whole query with ST_AsMVT(), which will create a protocol buffer
@paulyc
paulyc / gist:e969ea3ba41f9094c894d6e5efe8b6db
Created January 13, 2020 14:59 — forked from chriswhong/gist:762ceac7fb8a1420e7e7adceb770b707
Using ST_AsMVT() and ST_AsMVTGeom() in express to build a vector tile endpoint
/* GET /tiles/:z/:x/:y.mvt */
/* Retreive a vector tile by tileid */
router.get('/tiles/:z/:x/:y.mvt', async (req, res) => {
const { z, x, y } = req.params;
// calculate the bounding polygon for this tile
const bbox = mercator.bbox(x, y, z, false);
// Query the database, using ST_AsMVTGeom() to clip the geometries
// Wrap the whole query with ST_AsMVT(), which will create a protocol buffer