Skip to content

Instantly share code, notes, and snippets.

View joeeeeey's full-sized avatar
:shipit:
On vacation

Joey joeeeeey

:shipit:
On vacation
  • Shanghai, China
View GitHub Profile
@joeeeeey
joeeeeey / default.md
Created July 9, 2025 04:31 — forked from cablej/default.md
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.
@joeeeeey
joeeeeey / breakpoint-uploader.js
Last active February 14, 2019 09:06
Cut file for breakpoint uploader.
'use strict';
const Controller = require('../../../controller/baseController');
const { initTempFiles } = require('../../../utils/tools');
const md5Tool = require('../../../utils/md5');
const { success, failure } = require('../../../utils/apiResponse');
const {
FILE_MD5_CHECK_FAILED,
BLOCK_UPLOAD_TASK_NOT_EXIST,
BLOCK_UPLOAD_TASK_HAS_BEEN_CANCELLED
} = require('../../../exception/exceptionCode');
@joeeeeey
joeeeeey / s2s.rb
Created August 9, 2018 15:11
Ruby convert string hash key to symbol
hash = {"a" => {"b" => "c"}, "d" => "e", Object.new => "g"}
s2s =
lambda do |h|
Hash === h ?
Hash[
h.map do |k, v|
[k.respond_to?(:to_sym) ? k.to_sym : k, s2s[v]]
end
] : h
@joeeeeey
joeeeeey / update_by_nested_key.js
Created April 9, 2018 12:07
Javascript Update Deep Object by Nested Key String
let key = "(0){div}(1){EditableTextArea},props,content"
let keys = key.split(',')
let obj = {"(0){div}(1){EditableTextArea}": {props: {content: "dsfd"}}}
let value = "hello"
function connectKeys(keys){
let str = ""
for(let i=0; i<keys.length; i++){
str += `['${keys[i]}']`
}
@joeeeeey
joeeeeey / hash_array_to_csv_file.rb
Created January 12, 2018 03:22
Ruby Convert hash array to csv file.
require 'csv'
hashes = [{'a' => 'aaaa', 'b' => 'bbbb'}]
column_names = hashes.first.keys
s=CSV.generate do |csv|
csv << column_names
hashes.each do |x|
csv << x.values
end
end
File.write('the_file.csv', s)
@joeeeeey
joeeeeey / read_big_file_and_fliter.rb
Last active January 12, 2018 08:26
Ruby read big file, filter and delete line.
output_file_path = "output_file_path"
input_file_path = "input_file_path"
open(input_file_path, 'r') do |f|
open(output_file_path, 'w') do |f2|
f.each_line do |line|
if line != "\n" # logic here
f2.write(line)
end
end
@joeeeeey
joeeeeey / scripts.rb
Created December 13, 2017 09:40
some ruby scripts
# 将 app/models下的文件包含 jd_ 的转化为 rails 风格的表名复数
# => ["has_many :jd_bt_bill_lists", "has_many :jd_bank_card_lists"
```ruby
Dir.entries('app/models').grep(/jd_/).map {|x| "has_many :"+x.gsub(".rb", "").camelcase.constantize.table_name}
```
@joeeeeey
joeeeeey / is_boolean_value.rb
Created November 27, 2017 06:58
Check variable is a boolean value[Ruby]
!value.nil? && !!value != value
@joeeeeey
joeeeeey / githubusercontent.md
Last active December 31, 2024 12:03
repository 中图片等资源对应的 githubusercontent 地址

Format

https://raw.githubusercontent.com/[githubUsername]/[repository]/[branch]/[imgPath]

Example

https://raw.githubusercontent.com/joeeeeey/Havoc-in-Heaven/master/app/assets/images/screenshot/shoot1.png
@joeeeeey
joeeeeey / common_used_regex.rb
Last active November 7, 2017 08:59
记录常用的正则表达式
## 一、取出字符串中某两个字符(或串)之间的字符串并做替换
### 简单使用:
### Ex: 取出左边字符串为 "begin" , 右边字符串为 "end"中间值
"beginasdfend".match(/begin(.*)end/)[1] # => "asdf"
### 复杂案例
### Ex: 取出eval()中的值,运行并且替换
### 如: "hello-=eval(Time.now) ffdsf" => "hello-=2017-11-06 15:12:11 +0800 ffdsf"