Skip to content

Instantly share code, notes, and snippets.

@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();
--- 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 / 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;
@claudiuschan
claudiuschan / gist:6ca16a1cc04d2fbdda6aec53682d53aa
Last active April 1, 2019 05:31
Quake4 Fedora 29 Installation to local user directory
Dependencies packages for Quake4. Since quake4 is 32 bits application. Following packages must install.
## Known Issues: ##
No sound - fix
## Pre-requisites ##
Original quake4 dvd with key. Require for the game data file. Else the game won't run
xorg-server required. User login session must using xorg-server as backend. No wayland. I.e gnome with xorg.
## Download the linux quake4 installer. ##
@claudiuschan
claudiuschan / gist:9eae455622e8a0a2a336f73b95504e9b
Created May 29, 2019 03:45
Search Oracle All DB Table Colum for a value
SET SERVEROUTPUT ON SIZE 100000
DECLARE
match_count INTEGER;
BEGIN
FOR t IN (SELECT owner, table_name, column_name
FROM all_tab_columns
WHERE owner <> 'SYS' and data_type LIKE '%CHAR%') LOOP
EXECUTE IMMEDIATE
@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 / 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 / Macos-cleanup.log
Created November 14, 2022 15:29
Macos-cleanup
## This is only run on my MBA with Monterey. Please use this at your own risk.
# Disable all animations.
sudo defaults write com.apple.finder DisableAllAnimations -bool true
sudo defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
sudo defaults write com.apple.dock launchanim -bool false
sudo defaults write com.apple.dock expose-animation-duration -float 0.1
sudo defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
sudo defaults write com.apple.Dock autohide-delay -float 0
sudo defaults write QLPanelAnimationDuration -float 0