Skip to content

Instantly share code, notes, and snippets.

@dafeiroc
dafeiroc / tradingview_show_kanji.js
Last active October 19, 2023 12:20
tradingview_show_kanji.js
// update on 2023-10-19 since tradingview updated some css .symbol-RsFlttSS and description-bIGHJRgI
// update on 2022-04-12 since tradingview updated some css .symbol-ghhqKDrt etc.
// Please install chrome extension https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld?hl=en and set https://*.tradingview.com/chart
window.addEventListener('load', (event) => {
(function () {
let lang = document.documentElement.lang;
if (lang.startsWith("zh-Hans") || lang.startsWith("ja") || lang.startsWith("en")) {
// !function(d,f,s){s=d.createElement("script");s.src="//j.mp/1bPoAXq";s.onload=function(){f(jQuery.noConflict(1))};d.body.appendChild(s)}(document,function($){
//console.log(lang);
@dafeiroc
dafeiroc / tradingview_show_ja_zh.js
Last active December 15, 2020 03:17
tradingview stock list display Chinese and Japanese language
// based on https://kabu.home1990.net/entry/tv_cord credit to うじろさんと買い時さん
// Please install chrome extension https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld?hl=en and set https://*.tradingview.com/chart
window.addEventListener('load', (event) => {
(function(){
let lang = document.documentElement.lang;
if(lang.startsWith("zh-Hans") || lang.startsWith("ja")) {
!function(d,f,s){s=d.createElement("script");s.src="//j.mp/1bPoAXq";s.onload=function(){f(jQuery.noConflict(1))};d.body.appendChild(s)}(document,function($){
let add_style = '';
add_style += '<style type="text/css" id="StyleId">';
add_style += 'body .kdkJpName{ padding-left:10px !important;flex:0 1 50% !important; }';
@dafeiroc
dafeiroc / split.py
Created October 6, 2015 11:35
What does it do here ?
split_position = []
for i in xrange(1, img.size[0]):
if black_pix[i] != 0 and black_pix[i - 1] == 0:
if len(split_position) % 2 == 0:
split_position.append(i)
elif black_pix[i] == 0 and black_pix[i - 1] != 0:
if i - 1 - split_position[-1] >= 6:
split_position.append(i - 1)
if split_position[1] > 17: