Skip to content

Instantly share code, notes, and snippets.

View CaiJimmy's full-sized avatar

Jimmy CaiJimmy

  • Zürich, Switzerland
  • 11:37 (UTC +01:00)
View GitHub Profile
@CaiJimmy
CaiJimmy / cloud-function--http.js
Last active May 4, 2020 09:16
Firebase pagination
/* HTTP Function to initialize / reset question counter manually */
const express = require('express');
const cors = require('cors')({
origin: true
});
const app = express();
app.use(cors);
app.get('/', (req, res) => {
const topicID = req.query.topicID,
@CaiJimmy
CaiJimmy / delete.js
Created May 29, 2018 14:39
Delete Liked Tweets
function click(){
return new Promise(resolve=>{
[...document.querySelectorAll('.js-stream-item.stream-item')].forEach(container => {
container.querySelector('.ProfileTweet-action--unfavorite').click();
container.remove();
});
resolve();
})
};
@CaiJimmy
CaiJimmy / config.toml
Last active July 23, 2017 09:20
Hugo Search
[outputs]
home = ["HTML", "RSS", "JSON"]
@CaiJimmy
CaiJimmy / keybase.md
Last active January 7, 2018 20:45
keybase.md

Keybase proof

I hereby claim:

  • I am CaiJimmy on github.
  • I am jimmycai (https://keybase.io/jimmycai) on keybase.
  • I have a public key whose fingerprint is AB5B 5B5A 9B33 78C6 7FA9 B6C2 E3D5 D635 F780 1C9E

To claim this, I am signing this object:

@CaiJimmy
CaiJimmy / Post.hbs
Created January 20, 2017 23:49
Ghost Lazyload images
<section class="post-content">
<noscript>{{content}}</noscript>
</section>
@CaiJimmy
CaiJimmy / Archive.js
Last active April 16, 2022 08:16
Ghost Archive Page
$(document).ready(function(){
if($('#archivePage').length){
var $item = $('.archiveList--item'),
dates = {};
$item.each(function(){
dates[$(this).data('date')] = '';
});
for (date in dates) {
@CaiJimmy
CaiJimmy / config.js
Last active August 14, 2020 04:53
M. Theme Config
var MConfig = {
siteName: "{{@blog.title}}",
twitterName: '',
qiniuURL: '',
defaultColor: '#00BCD4',
loadMore: '0',
disqus_load: '0',
disqus_shortname: ''
}
@CaiJimmy
CaiJimmy / absolute.js
Last active August 29, 2015 14:22
七牛镜像地址替换
$('img[src^="https://nichijou.org/content/images"]').each(function(){
var src = $(this).attr("src")
var newsrc = src.replace( 'https://nichijou.org', '//CDN-URL.qbox.me' );
$(this).attr("src", newsrc );
})
@CaiJimmy
CaiJimmy / index.html
Last active April 29, 2024 08:43
Disqus点击加载
<button id="load-disqus" onclick="disqus.load();">
加载Disqus
</button>
<div id="disqus_thread"></div>