Skip to content

Instantly share code, notes, and snippets.

View sundevilyang's full-sized avatar
😃

Yang Wen sundevilyang

😃
  • ByteDance
  • Beijing
View GitHub Profile
@sundevilyang
sundevilyang / custom.css
Last active January 19, 2024 07:05
logseq
/* Theme custom css start
Dracula Theme for Logseq
Source: https://raw.githack.com/dracula/logseq/master/custom.css
*/
/* Importing fonts from Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;700&family=Fira+Sans:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap");
/* Root variable definitions for theme colors and font settings */
:root {
@sundevilyang
sundevilyang / vscode-extensions
Created December 31, 2022 05:06
vscode extensions
code --install-extension amodio.tsl-problem-matcher
code --install-extension animus-coop.vscode-elixir-mix-formatter
code --install-extension Arsen.darcula-theme-for-elixir
code --install-extension bajdzis.vscode-database
code --install-extension benvp.vscode-hex-pm-intellisense
code --install-extension bierner.markdown-mermaid
code --install-extension bpruitt-goddard.mermaid-markdown-syntax-highlighting
code --install-extension bradlc.vscode-tailwindcss
code --install-extension christian-kohler.path-intellisense
code --install-extension Compulim.indent4to2
@sundevilyang
sundevilyang / pair.rb
Created September 3, 2019 13:51 — forked from cantin/pair.rb
GuangZhou RailsGirs Pair
tutors = ["***", "***", "***"]
girls = ["***", "***", "***"]
number = "To be defined"
tutors = tutors.shuffle(random: Random.new(number))
girls = girls.shuffle(random: Random.new(number))
result = Hash.new { |hash, key| hash[key] = [] }
tutors.cycle(3).each_with_index do |tutor, i|
result[tutor] << (girls[i] || "未配对")
@sundevilyang
sundevilyang / capybara cheat sheet
Created June 4, 2019 05:28 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@sundevilyang
sundevilyang / Gemfile
Last active June 4, 2019 04:51
configure rspec and capybara with ruby on rails
group :development, :test do
gem 'rspec-rails'
gem 'capybara'
gem 'factory_bot_rails'
gem 'ffaker'
end
group :test do
gem 'cucumber-rails', require: false
gem 'database_cleaner'
@sundevilyang
sundevilyang / gist:e91a3d82c91cdbc467a96df37c3bbac1
Last active June 2, 2019 01:21
Setting Up RSpec \Capybara\Factory_bot In Rails 5
[Setting Up RSpec And Capybara In Rails 5 For Testing | Tandem](https://madeintandem.com/blog/setting-up-rspec-and-capybara-in-rails-5-for-testing/)
RSpec是Ruby社区中一个非常受欢迎的行为驱动开发(BDD)测试框架。
Capybara使我们的用户最终可以轻松地与应用程序进行交互:通过浏览器。它有一个可读的DSL和各种配置选项(我们稍后会介绍)。
## 获得工具
显然你会想要安装RSpec和Capybara,但是你也需要Selenium和Database Cleaner来帮助把它们放在一起。
将它们添加到:test和:development您的组中Gemfile,然后bundle install:
#!/usr/bin/python3
import logging
import re
from functools import wraps
import requests
from wxpy import *
logging.basicConfig(level=logging.INFO)
@sundevilyang
sundevilyang / gist:54bdf83a92526e191907d199e783cf40
Created May 16, 2017 04:54
wechat_robot_auto_accept_and_invitate_to_group
#!/usr/bin/python3
import logging
import time
from wxpy import *
logging.basicConfig(level=logging.INFO)
# 减少网络层日志的干扰
for m in 'requests', 'urllib3':
@sundevilyang
sundevilyang / wxpy_group.py
Created April 18, 2017 03:00 — forked from youfou/ad_urls.json
响应好友请求 / 自动聊天 / 限制频率 / 邀请入群 / 远程群管理 / 新人欢迎消息 / 关键词问答 / 发心跳 / 远程命令 / 远程执行代码
#!/usr/bin/env python3
# coding: utf-8
import datetime
import logging
import os
import re
import subprocess
import time
from functools import wraps
@sundevilyang
sundevilyang / devise.zh-CN.yml
Created July 7, 2016 15:13 — forked from Kenrick-Zhou/devise.zh-CN.yml
rails devise 3.5.2 I18n translations zh-CN
# Chinese (China) translations for Devise(3.5.2)
# by Kenrick-Zhou (https://github.com/Kenrick-Zhou)
# https://gist.github.com/Kenrick-Zhou/7909822
zh-CN:
devise:
confirmations:
confirmed: "您的帐号已经确认,您现在已登录。"
send_instructions: "几分钟后,您将收到确认帐号的电子邮件。"
send_paranoid_instructions: "如果您的邮箱存在于我们的数据库中,您将收到一封确认账号的邮件。"