Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Qichunren qichunren

🎯
Focusing
View GitHub Profile
View mac-cleanup
#!/usr/bin/env bash
# inspired by
# https://gist.github.com/JannikArndt/feb720c1f5d210b4820b880af23f2a07
# which was inspired by
# https://github.com/fwartner/mac-cleanup/blob/master/cleanup.sh
# https://gist.github.com/jamesrampton/4503412
# https://github.com/mengfeng/clean-my-mac/blob/master/clean_my_mac.sh
# https://github.com/szymonkaliski/Dotfiles/blob/master/Scripts/clean-my-mac
# http://brettterpstra.com/2015/10/27/vacuuming-mail-dot-app-on-el-capitan/ / https://github.com/pbihq/tools/blob/master/MailDBOptimiser.sh
@qichunren
qichunren / README.md
Last active Oct 8, 2021
rails project default template
View README.md
bundle exec rails new ~/code/sitebuilder --javascript=esbuild --css=tailwind --dev --database=postgresql --skip-action-mailbox
@qichunren
qichunren / README.md
Last active Sep 2, 2021
Install Arch Linux on Virtualbox
View README.md

分区

Use fdisk -l to view current device info. Use gdisk to create partitions.

三个分区:

  • EFI分区 (ef00)
  • / 根分区
  • /home 分区
View jquery-1.8.3.min.js
/*! jQuery v1.8.3 jquery.com | jquery.org/license */
(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,funct
View jquery.flexslider-min.js
/*
* jQuery flexslider_common v2.2.0
* Copyright 2012 WooThemes
* Contributing Author: Tyler Smith
*/(function(e){e.flexslider_common=function(t,n){var r=e(t);r.vars=e.extend({},e.flexslider_common.defaults,n);var i=r.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,o=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&r.vars.touch,u="click touchend MSPointerUp",a="",f,l=r.vars.direction==="vertical",c=r.vars.reverse,h=r.vars.itemWidth>0,p=r.vars.animation==="fade",d=r.vars.asNavFor!=="",v={},m=!0;e.data(t,"flexslider_common",r);v={init:function(){r.animating=!1;r.currentSlide=parseInt(r.vars.startAt?r.vars.startAt:0);isNaN(r.currentSlide)&&(r.currentSlide=0);r.animatingTo=r.currentSlide;r.atEnd=r.currentSlide===0||r.currentSlide===r.last;r.containerSelector=r.vars.selector.substr(0,r.vars.selector.search(" "));r.slides_common=e(r.vars.selector,r);r.container=e(r.containerSelector,r);r.count=r.slides_common.length;r.syncExists=e(
@qichunren
qichunren / build_config.rb
Last active May 11, 2021
mruby cross compie to arm64
View build_config.rb
MRuby::Build.new do |conf|
# load specific toolchain settings
conf.toolchain
# Use mrbgems
# conf.gem 'examples/mrbgems/ruby_extension_example'
# conf.gem 'examples/mrbgems/c_extension_example' do |g|
# g.cc.flags << '-g' # append cflags in this gem
# end
# conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
@qichunren
qichunren / get_number_combined_list.cpp
Created Apr 25, 2021
通过1,2,5,10组合出数字
View get_number_combined_list.cpp
// 通过1,2,5,10组合出数字
static QList<quint8> get_number_combined_list(int number)
{
QList<quint8> result;
if(number < 1)
{
return result;
}
// 0 -> null
// 1 -> [1]
@qichunren
qichunren / README.md
Created Feb 18, 2021
wordpress notes
View README.md
  • action
  • filter
View cairo_demo.c
#include <cairo.h>
#include <stdio.h>
// sudo apt-get install libpango1.0-dev
// gcc cairo-demo.c $(pkg-config --cflags --libs pangocairo)
int main()
{
cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 200, 200);
cairo_t *cr = cairo_create(surface);
cairo_surface_destroy(surface);
View cpp_demo.cpp
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <vector>
using namespace std;
class Str{
public:
char *value;
Str(char s[])
{