Skip to content

Instantly share code, notes, and snippets.

View ccrocc's full-sized avatar
🚀
Don't panic.

ccro ccrocc

🚀
Don't panic.
View GitHub Profile
@ccrocc
ccrocc / pom.xml
Created August 1, 2022 07:05
maven pom.xml文件教程详解
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
<!-- 父项目的坐标。如果项目中没有规定某个元素的值,那么父项目中的对应值即为项目的默认值。 坐标包括group ID,artifact ID和 version。 -->
<parent>
<!-- 被继承的父项目的构件标识符 -->
<artifactId />
<!-- 被继承的父项目的全球唯一标识符 -->
@ccrocc
ccrocc / electron-sha512.js
Created June 4, 2020 21:06
Gen Sha512 in Electron
const path = require('path');
const fs = require('fs');
const crypto = require('crypto');
const YOUR_FILE_PATH = '{YourFileWithPath}'; // POPULATE THIS
function hashFile(file, algorithm = 'sha512', encoding = 'base64', options) {
return new Promise((resolve, reject) => {
const hash = crypto.createHash(algorithm);
hash.on('error', reject).setEncoding(encoding);
@ccrocc
ccrocc / install.sh
Created May 9, 2020 00:00 — forked from rexlow/install.sh
Enable zsh in Gcloud shell
##
# This is an adoption from Oh My Zsh for Google Cloud Shell
# author - bobvanluijt
# source - https://github.com/bobvanluijt/google-cloud-shell-pro-zsh
##
main() {
# Install zsh
sudo apt-get -qq update
@ccrocc
ccrocc / gist:0271aa8bff36a1c5504355e48e7d3317
Last active April 20, 2020 23:46
Uninstall brew package and dependencies
Remove package's dependencies (does not remove package):
brew deps [FORMULA] | xargs brew remove --ignore-dependencies
Remove package:
brew remove [FORMULA]
Reinstall missing libraries:
brew missing | cut -d: -f2 | sort | uniq | xargs brew install
@ccrocc
ccrocc / MCrawler.js
Last active April 13, 2020 01:08
node spider library with `crawler`
'use strict'
const Crawler = require('crawler')
class MCrawler {
constructor(newConfig, callback) {
this.c = this.createCrawler(newConfig, callback)
}
/**
* 初始化爬虫配置
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@ccrocc
ccrocc / .vimrc
Created February 26, 2020 16:53
my vim configuration
"复制无上限
set viminfo='1000,<800
" 不要使用vi的键盘模式,而是vim自己的
set nocompatible
" 语法高亮
set syntax=on
" 去掉输入错误的提示声音
@ccrocc
ccrocc / advanced_searching.md
Last active February 1, 2020 20:46
Advanced Searching

Advanced Searching

##分布式系统(Distributed System)资料


#####希望转载的朋友,你可以不用联系我.但是一定要保留原文链接,因为这个项目还在继续也在不定期更新.希望看到文章的朋友能够学到更多.

介绍:这是一篇介绍在动态网络里面实现分布式系统重构的paper.论文的作者(导师)是MIT读博的时候是做分布式系统的研究的,现在在NUS带学生,不仅仅是分布式系统,还有无线网络.如果感兴趣可以去他的主页了解.

@ccrocc
ccrocc / .bash_profile
Last active November 15, 2019 21:18
mac terminal profiles
alias py=python
## open with mou/macdown,to write markdown
#alias md="/Applications/Mou.app/Contents/MacOS/Mou"
alias md=openmd
openmd(){
if [ -f $@ ] ; then
open $@
else
touch $@