Skip to content

Instantly share code, notes, and snippets.

View luikore's full-sized avatar

luikore luikore

View GitHub Profile
@Birch-san
Birch-san / code-assist.md
Last active March 4, 2024 19:32
Local VSCode AI code assistance via starcoder + 4-bit quantization in ~11GB VRAM

Install HF Code Autocomplete VSCode plugin.

We are not going to set an API token. We are going to specify an API endpoint.
We will try to deploy that API ourselves, to use our own GPU to provide the code assistance.

We will use bigcode/starcoder, a 15.5B param model.
We will use NF4 4-bit quantization to fit this into 10787MiB VRAM.
It would require 23767MiB VRAM unquantized. (still fits on a 4090, which has 24564MiB)!

Setup API

@skfarhat
skfarhat / VSCode Internal Commands
Created May 19, 2020 21:22
List of VSCode commands
--------------------------------------------
Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.5.0
-------------------------------------------
@crhan
crhan / README.md
Last active September 19, 2018 14:40
MotionLights for HomeAssistant

支持的功能:

  1. 支持光照度条件, 环境光足够亮就不开灯, 例如阳台灯
  2. 支持多个 sensor 共同触发, 例如卫生间可以放两个人体传感器, 玄关可以放一个门窗传感器+人体传感器
  3. 支持只关不开(厕所排气扇场景)或者只开不关(不知道为啥要这样, 你想到了告诉我)
  4. 支持延时关闭, 根据自身情况设定, 规避人体传感器不灵敏的问题

这个功能不适合经常有人呆着的地方, 比如书房, 卧室, 客厅.

@ashchan
ashchan / HairlineView.swift
Last active August 29, 2015 14:22
Draw a half pixel horizontal line
import UIKit
// How to use
// Drag an UIView to storyboard, set constraints.
// Set the height constraint priority to less than 1000.
// The view will override that to half pixel.
class HairlineView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
}
@delonnewman
delonnewman / yin-yang.rb
Last active November 9, 2015 21:29
Messing around with mimicking Scheme in Ruby by implementing the Yin Yang puzzle with Kernel#callcc and a fake 'let' macro
require 'continuation'
#
# Messing around with mimicking Scheme in Ruby by implementing the Yin/Yang puzzle with Kernel#callcc and a fake 'let' macro
#
# See also:
# http://blog.gonzih.me/blog/2013/11/26/yin-yang-callcc-puzzle-in-ruby/,
# http://stackoverflow.com/questions/16843853/how-to-implement-let-in-scheme
#
# In Scheme (the original)
@denji
denji / unbound-osx-homebrew.md
Last active November 27, 2022 08:33
Install unbound DNS(SEC) resolver on OS X, on the basis of https://www.spatof.org/blog/unbound-dns-resolver-on-osx.html
To install unbound you can use homebrew
$ brew install unbound ldns
Now we can edit the configuration file of unbound which by default is located in /usr/local/etc/unbound/unbound.conf:
@jimweirich
jimweirich / adhoc.sh
Last active July 22, 2017 18:47
Controlling multiple drones with a single Ruby program.
# This script should be run on the drone.
# Change the IP address to be difference
# for each drone on the same ad-hoc network
#
killall udhcpd
ifconfig ath0 down
iwconfig ath0 mode ad-hoc essid ardrone2_070401 channel auto commit
ifconfig ath0 192.168.1.100 netmask 255.255.255.0 up
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@derekwyatt
derekwyatt / execOnChange.sh
Created September 1, 2012 15:32
Executes an arbitrary command when files change.
#!/bin/bash
command="$1"
shift
fileSpec="$@"
sentinel=/tmp/t.$$
touch -t197001010000 $sentinel
while :
do