Skip to content

Instantly share code, notes, and snippets.

View KrisYu's full-sized avatar

Xue Yu KrisYu

View GitHub Profile
@scivision
scivision / CMakeLists.txt
Last active November 8, 2024 13:55
OpenMP with CMake
cmake_minimum_required(VERSION 3.19)
project(OpenMPdemo LANGUAGES C)
find_package(OpenMP COMPONENTS C REQUIRED)
add_executable(hello hello_openmp.c)
target_link_libraries(hello PRIVATE OpenMP::OpenMP_C)
@rogue6800
rogue6800 / CameraOrbit.cs
Last active January 7, 2024 23:13
Smooth Mouse Orbit Camera
//Adapted from: https://wiki.unity3d.com/index.php/MouseOrbitImproved
//License: Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
//https://creativecommons.org/licenses/by-sa/3.0/
//Link to demo: https://youtu.be/I_7PyyzziTY
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraOrbit : MonoBehaviour
@rfong
rfong / compile_tags.py
Created May 17, 2021 22:51
Automatic tag-page generator for all post tags on a Jekyll site. See https://rfong.github.io/rflog/2020/02/28/jekyll-tags/
# Filename: __plugins/compile_tags.py
'''
This script generates tag pages for all your post tags for a
Jekyll site. It is invoked from a plugin after post_write.
Run it from the project root if testing.
Convention expected here for tag names is r/[-\w\d]+/
'''
import glob
@rubyandcoffee
rubyandcoffee / Ruby with chruby
Last active November 12, 2024 21:36
chruby - Installing and managing Ruby versions
To install chruby and ruby-install:
brew install chruby ruby-install
To install Ruby using ruby-install:
ruby-install ruby 2.7.1
NOTE: You can find latest stable version of Ruby here: https://www.ruby-lang.org/en/downloads/
If you have issues installing Ruby then try the following:
brew install openssl@3
ruby-install 3.2.2 -- --with-openssl-dir=$(brew --prefix openssl@3)
@jclosure
jclosure / concave_hulls.ipynb
Created January 27, 2020 00:11 — forked from dwyerk/concave_hulls.ipynb
concave hulls using shapely and scipy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@caseywatts
caseywatts / 0-self-publishing.md
Last active October 5, 2024 11:27
Self-Publishing via Markdown
@kylemcdonald
kylemcdonald / Line Segment Intersection.ipynb
Created July 2, 2019 18:49
Python Line Segment Intersection example.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scottgarner
scottgarner / WebSocketBridge.cs
Created April 18, 2019 04:59
Unity WebSocket Bridge using System.Net.WebSockets
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Net.WebSockets;
using UnityEngine;
@jeasinema
jeasinema / delaunay.py
Last active November 11, 2024 08:04
A python implementation of delaunay algorithm
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
# File Name : face_morphing.py
# Creation Date : 04-04-2018
# Created By : Jeasine Ma [jeasinema[at]gmail[dot]com]
import cv2
import json
import numpy as np
@akey7
akey7 / numpy_array_to_wav_file.py
Created March 31, 2018 02:55
Generate a .wav sound file from a NumPy array.
import numpy as np
from scipy.io.wavfile import write
# Samples per second
sps = 44100
# Frequency / pitch of the sine wave
freq_hz = 440.0
# Duration