Skip to content

Instantly share code, notes, and snippets.

@booox
booox / index.html
Created May 29, 2019 15:33
javascript-in-14-minutes
<html class="case-desktop case-chrome case-mac hb-loaded"><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>JavaScript in 14 minutes by Jeremy Thomas</title>
<link rel="stylesheet" href="https://jgthms.com/javascript-in-14-minutes/css/main.min.css?v=201905170834">
<meta property="og:url" content="https://jgthms.com/javascript-in-14-minutes">
<meta property="og:type" content="website">
<meta property="og:title" content="JavaScript in 14 minutes">
<meta property="og:image" content="https://jgthms.com/javascript-in-14-minutes/images/javascript-in-14-minutes.png">
@booox
booox / rails_version.html
Created March 14, 2019 11:20
rails_version.js
<select id="rails_version" class="form-control">
<option value="5.2.2">
5.2.2 (Recommended)
</option>
<option value="5.1.6.1">
5.1.6.1
</option>
</select>
@booox
booox / coderay.css
Last active December 18, 2018 02:03
Redcarpet syntax highlighting coderay and rouge stylesheet
.CodeRay {
background-color: hsl(0,0%,95%);
border: 1px solid silver;
color: black;
}
.CodeRay pre {
margin: 0px;
}
span.CodeRay { white-space: pre; border: 0px; padding: 2px; }
@booox
booox / _google_plus_share.html.erb
Created August 6, 2018 15:36
common/_google_plus_share.html.erb
<a href="https://plus.google.com/share?url=<%= url %>"
class="ui google plus circular icon button"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=500');return false;">
<i class="google plus icon"></i>
</a>
@booox
booox / index.html
Created May 20, 2018 14:41
Rainbow with CSS
<html>
<head>
<link rel="stylesheet" href="rainbow.css">
</head>
<body>
<div class="rainbow">
<div class="bows">
<span></span>
<span></span>
<span></span>
# ------- from wordcloud.py -------------
# remove stopwords
words = [word for word in words if word.lower() not in stopwords]
# remove 's
words = [word[:-2] if word.lower().endswith("'s") else word
for word in words]
# remove numbers
words = [word for word in words if not word.isdigit()]
@booox
booox / 180227-wechat-style-for-markdown-here.css
Last active February 27, 2018 11:14
zxs - markdown-here.css
.markdown-here-wrapper {
font-size: 16px;
line-height: 1.8em !important;
letter-spacing: 0.1em !important;
}
pre, code {
font-size: 0.85em;
font-family: Consolas, Inconsolata, Courier, monospace;
}
@booox
booox / passwords-edit.html.erb
Created November 10, 2017 15:03
app/views/users/registrations/edit.html.erb
<h2>Change your password</h2>
<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= f.error_notification %>
<%= f.input :reset_password_token, as: :hidden %>
<%= f.full_error :reset_password_token %>
<div class="form-inputs">
<%= f.input :password, label: "New password", required: true, autofocus: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length) %>
@booox
booox / chat.js
Created November 8, 2017 02:20
conversation message notification
// https://github.com/chetanbissa27/chat/blob/54f670a23343841bddcc046e4358ae250758bc81/app/assets/javascripts/chat.js
update_notifications: function(conversation_id){
if($('#chatbox_' + conversation_id + ' .chatboxcontent').css('display') == "block"){
$.post('/conversations/' + conversation_id + '/messages/update_status',function(data){
if($("#notification_"+conversation_id).length > 0) {
$("#notification_" + conversation_id).remove();
var count = $("#notifications li").length > 0 ? $("#notifications li").length : "";
$("#notify_count").html(count);
}
@booox
booox / complain.js.erb
Created November 7, 2017 09:33
javascript flash_messages
$('#complain-submit-status-srea').flash_message({
text: "您的吐槽/反馈已经收到,我们会及时通过站内信给您回复",
how: 'append',
time: 2500
});