Skip to content

Instantly share code, notes, and snippets.

@claudiuschan
claudiuschan / RangeHTTPServer.py
Created May 2, 2020 14:22 — forked from shivakar/RangeHTTPServer.py
Python's SimpleHTTPServer extended to handle HTTP/1.1 Range requests
import os
import SimpleHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
class RangeHTTPRequestHandler(SimpleHTTPRequestHandler):
"""RangeHTTPRequestHandler is a SimpleHTTPRequestHandler
with HTTP 'Range' support"""
def send_head(self):
"""Common code for GET and HEAD commands.
@claudiuschan
claudiuschan / chn_fonts.reg
Created April 8, 2020 03:17 — forked from swordfeng/chn_fonts.reg
Chinese font settings in wine
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]
"Arial"="wqy-microhei.ttc"
"Arial Black"="wqy-microhei.ttc"
"Arial CE,238"="wqy-microhei.ttc"
"Arial CYR,204"="wqy-microhei.ttc"
"Arial Greek,161"="wqy-microhei.ttc"
"Arial TUR,162"="wqy-microhei.ttc"
"Courier New"="wqy-microhei.ttc"
@claudiuschan
claudiuschan / debounce.js
Last active September 5, 2022 21:17 — forked from nmsdvid/new_gist_file.js
Simple JavaScript Debounce Function
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate = true` is passed, trigger the function on the
// leading edge, instead of the trailing.
// Debounce function to slow down the scrolling trigger
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
--- dsdt.dsl 2018-03-04 16:00:00.866484238 -0800
+++ dsdt.dsl 2018-03-04 16:28:07.933272752 -0800
@@ -18,9 +18,8 @@
* Compiler ID "INTL"
* Compiler Version 0x20160527 (538314023)
*/
-DefinitionBlock ("", "DSDT", 2, "LENOVO", "SKL ", 0x00000000)
+DefinitionBlock ("", "DSDT", 2, "LENOVO", "SKL ", 0x00000001)
{
- External (_GPE.TBNF, MethodObj) // 0 Arguments
@claudiuschan
claudiuschan / pinch-zoom-image.js
Last active July 17, 2018 17:00 — forked from jshbrntt/pan-zoom-image.js
A simple way of panning and zooming an image using Hammer.js.
//image to pinch
<img id="hammerFrame" src="images/tutorials.jpeg" />
<script>
var myElement = document.getElementById('hammerFrame');
var mc = new Hammer.Manager(myElement);
var webpage = document.querySelector("#hammerFrame");
// create a pinch and rotate recognizer
// these require 2 pointers
var pinch = new Hammer.Pinch();