Skip to content

Instantly share code, notes, and snippets.

@qx
qx / gist:8588c59ee08e41b00848bacb60c6df77
Created January 25, 2022 12:44 — forked from renzihui/gist:c44c296114712cd9a7101a82a5404146
Facebook Data Deletion Request Callback in Java
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@qx
qx / cpp
Last active June 13, 2019 11:03
test
/**
* @file MatchTemplate_Demo.cpp
* @brief Sample code to use the function MatchTemplate
* @author OpenCV team
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
@qx
qx / cloudSettings
Created April 2, 2019 01:35
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-04-02T01:34:17.016Z","extensionVersion":"v3.2.7"}
@qx
qx / app.html
Created September 27, 2016 09:46 — forked from nch3ng/Froala and Carrierwave-RoR Demo.html
Image upload with Froala and Rails 4, Carrierwave
...
...
<textarea froala="froalaOptions"></textarea>
...
...

Force RGB mode in Mac OS X to fix the picture quality of an external monitor (Original)

Update: I have heard that 10.8.3 has solved this problem for some people, so I rolled back my changes and installed the update. No change on my monitor. Nevertheless, it’d be a good idea to update OS X before trying this, since it may fix the issues with your particular hardware.

I recently bought a MacBook Pro (with ‘Retina’ screen), but when I hooked it up to my Dell U2410 monitor via HDMI cable I was shocked by the poor picture quality. The contrast was all wrong and text was misshapen. No amount of calibration in the monitor or software would fix it.

Short answer: OS X thinks my monitor is a TV, and is using the YCbCr colour space rather than RGB. I had to override an EDID setting to force the RGB colour space, and it is now working correctly.

Long answer: I haven’t owned a Mac for a while and h

@qx
qx / patch-edid.rb
Last active August 29, 2015 14:06 — forked from adaugherity/patch-edid.rb
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten