This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APP=$1 | |
# This script is intended to temporarily bypass the "blank screen" bug in Anki on unsupported(?) | |
# GPUs (Dec 2021): <https://forums.ankiweb.net/t/anki-opens-but-all-windows-are-blank/8920/16> | |
# | |
# Adapted from a similar script by @ahihi for an app called "SuperCollider" that also uses qt on | |
# macOS: <https://github.com/supercollider/supercollider/issues/4136#issuecomment-605447703> | |
if [ -z "$APP" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/gin-gonic/gin" | |
"github.com/go-pg/pg" | |
) | |
type Word struct { | |
Id int64 | |
//Content string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<algorithm> | |
#include<list> | |
using namespace std; | |
static const int MAX = 10000; | |
vector<int> G[MAX]; | |
list<int> out; | |
bool V[MAX]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
data = Dir.glob("dist/**/*").map { |f| { file: f, size: File.size(f) } }.sort { |a, b| b[:size] <=> a[:size] }.each { |t| puts "size: #{t[:size]} , file: #{t[:file]}" } | |
total_size = data.reduce(0) { |s, f| f[:size] + s } | |
puts "Total size: #{total_size}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "fileutils" | |
require "digest" | |
def images | |
Dir.glob("src/assets/**/*").select { |f| !File.directory?(f) } | |
end | |
def unhashed_images | |
images.select { |f| f.slice(-8, 8) != sha1(f) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require("lodash"); | |
// 按扭ID(整型,不可重复),按扭名称(字符串),父ID(按扭之间的关系,可为空) | |
// 100,桌面,0 | |
// 101,开启桌面整理,100 | |
// 102,退出桌面整理,100 | |
// 103,一键桌面整理,100 | |
const file = [["按扭ID(整型,不可重复)", "按扭名称(字符串)", "父ID(按扭之间的关系,可为空)"], ["100", "桌面", "0"], ["101", "开启桌面整理", "100"], ["102", "退出桌面整理", "100"], ["103", "一键桌面整理", "100"], ["104", "新建分区", "100"], ["105", "新建分区-桌面右键", "104"], ["106", "新建分区-分区右键", "104"], ["107", "新建分区-标题栏", "104"], ["108", "解散分区", "100"], ["109", "解散分区-分区右键", "108"], ["110", "解散分区-菜单面板", "108"], ["111", "解散分区-标题栏", "108"], ["112", "锁定分区", "100"], ["113", "锁定分区-菜单面板", "112"], ["114", "锁定分区-标题栏", "112"], ["115", "重命名", "100"], ["116", "查看方式", "100"], ["117", "查看方式-分区右键", "116"], ["118", "大图标", "117"], ["119", "中等图标", "117"], ["120", "小图标", "117"], ["121", "查看方式-菜单面板", "116"], ["122", "大图标", "121"], ["123", "中等图标", "121"], ["124", "小图标", "121"], ["125", "查看方式-底部栏", "116"], ["126", "切换至图标模式", "125"], ["127", "切换至列表模式", "125"], ["128", "查看方式-桌面右键", "116"], ["129", "大图标", "128"], ["130", "中等图标", "128"], ["131", "小图标", "1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select OuterWrap.* | |
from ( | |
SELECT ROWNUM as AfterOrderRowNum, Wrap.* | |
FROM ( | |
SELECT "RechargeOrder"."CREATE_TIME" AS "RechargeOrder_CREATE_TIME" , | |
ROWNUM AS "BeforeOrderRowNum" | |
FROM "T_RECHARGE_ORDER" "RechargeOrder" | |
ORDER BY "RechargeOrder"."CREATE_TIME" DESC | |
) Wrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddPgTrgmExtensionToDb < ActiveRecord::Migration[5.0] | |
# def change | |
# # execute "remove extension pg_trgm;" | |
# execute "create extension IF NOT EXISTS pg_trgm;" | |
# execute "CREATE EXTENSION IF NOT EXISTS btree_gin;" | |
# | |
# remove_index :words, :word | |
# add_index :words, :word, using: :btree_gin | |
# end | |
def up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
utf8_msg = msg.dup.force_encoding(Encoding::GBK).encode('utf-8') # GBK to UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc 'get Models'do | |
headers "Authentication-Token"=>{description: 'token',required: true } | |
end | |
get 'all_models' do | |
Rails.application.eager_load! if Rails.env.development? | |
models = Mongoid::Config.models | |
#fields.values.map{|f| o = f.options;{name: f.name,type: o[:type], kclass: o[:klass].to_s }} | |
present :models, models.map{|m|{model_name: m.to_s, relations: m.relations, field_names: m.fields.keys, fields: m.fields.values.map{|f| o = f.options;{name: f.name,type: o[:type].to_s, kclass: o[:klass].to_s }}}} | |
end |
NewerOlder