Skip to content

Instantly share code, notes, and snippets.

View v1c77's full-sized avatar
🌕
super moon released!!!

vici v1c77

🌕
super moon released!!!
  • (0x1c ^ 0x77) + 7, (0x1c & 0x77) << 1
  • 02:56 (UTC +08:00)
View GitHub Profile
@v1c77
v1c77 / bypass_chrome_edge_CERT.applescript
Last active August 25, 2021 05:54
bypass chrome or edge NET::ERR_CERT_AUTHORITY_INVALID NET::ERR_CERT_INVALID certificate warning
--
-- Created by: v1c77
-- Created on: 2021/8/22
--
-- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-- Version 2, December 2004
-- Copyright (C) 2021 v1c77
-- Everyone is permitted to copy and distribute verbatim or modified
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
@v1c77
v1c77 / build_opencv.sh
Last active January 26, 2020 11:39
build opencv 4.20 on mac
cmake \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_EXAMPLES=ON \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D WITH_QT=ON \
@v1c77
v1c77 / movie.2.gif.md
Created August 17, 2018 07:19
Convert movies to gif in OS X Mac

#OS X Movie to animated GIF

ffmpeg -i movie-name.mp4 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=0 --delay=3 > movie-name.gif

##Options

  • -r 10 tells ffmpeg to reduce the frame rate from 25 fps to 10
  • -s 600x400 tells ffmpeg the max-width and max-height
@v1c77
v1c77 / route-screen.applescript
Last active April 14, 2024 04:25
rotate display using applescript, tested on Mac os High Sierra(10.13)
--
-- Created by: v1c77
-- Created on: 2018/7/21
--
-- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-- Version 2, December 2004
-- Copyright (C) 2020 v1c77
-- Everyone is permitted to copy and distribute verbatim or modified
# -*- coding: utf-8 -*-
# PYTHON VERSION > 3.4
def base36encode(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
"""Converts an integer to a base36 string."""
if not isinstance(number, int):
raise TypeError('number must be an integer')
base36 = ''
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
start, next := 0, 1
return func() int {
package main
import (
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
words := strings.Fields(s)
package main
import (
"golang.org/x/tour/pic"
"math"
)
//实现 Pic 。它应当返回一个长度为 dy 的切片,其中每个元素是一个长度为 dx ,元素类型为 uint8 的切片
func Pic(dx, dy int) [][]uint8 {