Skip to content

Instantly share code, notes, and snippets.

@likai24
likai24 / README.md
Created May 18, 2023 00:58 — forked from lopspower/README.md
Publish AAR to jCenter and Maven Central

Publish AAR to jCenter and Maven Central

Twitter

EDIT: You can find this same updated tutorial here -> Medium

Now I'm going to list how to publish an Android libray to jCenter and then syncronize it with Maven Central:

  1. I use "Android Studio" and I have this simple android lib that I would like to be available on maven: CircularImageView
@likai24
likai24 / DesmosPlayer.user.js
Created January 28, 2022 04:51 — forked from jason-woolf/DesmosPlayer.user.js
Programmatically control a Desmos graph
// ==UserScript==
// @name desmosPlayer
// @namespace http://github.com/jason-woolf
// @version 1.0.0
// @description Program a series of graph changes to create animation
// @author Jason Woolf (MathyJaphy)
// @match https://www.desmos.com/calculator*
// @grant none
// @run-at document-idle
// ==/UserScript==
@likai24
likai24 / random_test.js
Created March 19, 2018 05:34
Random Collision Test
const crypto = require('crypto');
var count = 0;
var total = 0;
function getDt(){
var dt = (new Date()).toString()
var p = /\d+:\d+:\d+/.exec(dt);
if(p.length > 0){
return dt = p[0];
}
}
@likai24
likai24 / gist:d9861a4d02a5df99b0c6bb767ca57df9
Last active March 15, 2018 16:18
Building Electron with
sudo npm install node-gyp -g
sudo npm install sqlite3
cd node_modules/sqlite3
sudo node-gyp configure --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.8-darwin-x64
sudo node-gyp rebuild --target=1.8.1 --arch=x64 --target_platform=darwin --dist-url=https://atom.io/download/atom-shell --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.8-darwin-x64
#ref
#https://stackoverflow.com/questions/38716594/electron-app-cant-find-sqlite3-module
#https://stackoverflow.com/questions/32406397/using-nodejs-plugins-in-elelectron/32415283
#https://github.com/electron/electron/blob/master/docs/tutorial/using-native-node-modules.md
@likai24
likai24 / searchPrimes.js
Last active October 21, 2017 12:04
搜索素数
var primes = [];
for(var i = 3; i < 10; i++){
var noFactor = true;
//console.log('i = ', i);
for(var factor = 2; factor < i; factor++){
//console.log('factor = ', factor);
// check whether it has factor
if(i % factor == 0){
noFactor = false;
break;
@likai24
likai24 / server.js
Created October 6, 2017 10:48
一个简单的测试服务器
var http = require("http");
var server = http.createServer(function(request, response) {
console.log(request.headers);
console.log(request.method);
console.log(request.url);
var body = [];
request.on('data', function(chunk) {
body.push(chunk);
}).on('end', function() {
@likai24
likai24 / static.js
Last active October 6, 2017 10:47
一个简单的文件服务器
const express = require('express')
const app = express()
app.use(express.static('./folder'));
app.listen(3000, function () {
console.log('Example app listening on port 3000!')
})
@likai24
likai24 / read.go
Created September 21, 2017 10:47
read file using go
/*
from https://stackoverflow.com/questions/14514201/how-to-read-a-binary-file-in-go
*/
package main
import (
"fmt"
"io"
"os"
)
@likai24
likai24 / 2memory.c
Created September 21, 2017 09:54
read to memory
/*
A demo of reading the entire contents of a file. Other than
"echoing" the contents of the file to the console this program
does do anything useful.
The program assumes we have a file called test.dat in the same
directory as the executible.
M. Kesson
4.12.03
@likai24
likai24 / file.js
Created September 20, 2017 10:17
用nodejs来读文件 node file.js 文件名
var fs = require('fs');
var path = process.argv.slice(2).pop();
var start = new Date();
var readStream = fs.createReadStream(path);
readStream
.on('data', function (chunk) {
})
.on('end', function () {
var end = new Date();