Skip to content

Instantly share code, notes, and snippets.

View rikkix's full-sized avatar
💭
Busy...

Rikki rikkix

💭
Busy...
View GitHub Profile
@rikkix
rikkix / hello-world.c
Last active January 10, 2023 14:22
Runs on MacBook Pro M1 (macOS)
const char main[] = {
0x20, 0x00, 0x80, 0xd2, 0xe1, 0x00, 0x00, 0x10,
0xa2, 0x01, 0x80, 0xd2, 0x90, 0x00, 0x80, 0xd2,
0x01, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x80, 0xd2,
0x30, 0x00, 0x80, 0xd2, 0x01, 0x00, 0x00, 0xd4,
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f,
0x72, 0x6c, 0x64, 0x21, 0x0a, 0xc0, 0x03, 0x5f,
0xd6, 0x00, 0x00, 0x00,
};
@rikkix
rikkix / trss.go
Created December 28, 2022 11:41
convert Telegram Channel to RSS Feed
/*
MIT License
Copyright (c) 2020 Richard Chen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=64)}({12:function(e,t,n){var r;
/*!
* jQuery JavaScript Library v3.4.1
* https://jquery.com/
*
* Includes S
#!/bin/sh
p=`pwd`
binname=`basename $p`
mkdir $binname/{linux-386,linux-arm,linux-arm5,linux,freeBSD,win64,win32,mac,zip} -p
env GOARCH=386 GOOS=linux CGO_ENABLED=0 go build -v -o $binname/linux-386/$binname &
env GOARCH=arm GOOS=linux CGO_ENABLED=0 go build -v -o $binname/linux-arm/$binname &
env GOARCH=arm GOARM=5 GOOS=linux CGO_ENABLED=0 go build -v -o $binname/linux-arm5/$binname &
package main
import (
"fmt"
"math/rand"
"sort"
"time"
)
func main() {
@rikkix
rikkix / first_attempt.rs
Created March 27, 2021 14:45
first attempt on Rust
enum IPAddr {
IPv4(u8, u8, u8, u8),
IPv6(String),
}
fn main() {
let ip1 = IPAddr::IPv4(127, 0, 0, 1);
let ip2 = IPAddr::IPv6(String::from("::1"));
print_ip(&ip1);
print_ip(&ip2);
@rikkix
rikkix / mp3_player.go
Created March 27, 2021 04:48
playing mp3 with golang
package main
import (
"fmt"
"io"
"log"
"os"
"github.com/hajimehoshi/oto"
"github.com/tosone/minimp3"
@rikkix
rikkix / drive.html
Created February 3, 2021 04:19
thanks for onelist
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Drive</title>
<style>
@font-face{
font-family: 'icomoon';
src : url("data:application/x-font-woff;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBwQAAAC8AAAAYGNtYXDTrtL+AAABHAAAAGxnYXNwAAAAEAAAAYgAAAAIZ2x5Zizg66wAAAGQAAACOGhlYWQXasWNAAADyAAAADZoaGVhB8IDyQAABAAAAAAkaG10eBYAAJMAAAQkAAAAIGxvY2ECEgFAAAAERAAAABJtYXhwAA8AZgAABFgAAAAgbmFtZZlKCfsAAAR4AAABhnBvc3QAAwAAAAAGAAAAACAAAwOaAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADqQAPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAUAAAABAAEAADAAAAAQAg6QDpJukw6kD//f//AAAAAAAg6QDpJukw6kD//f//AAH/4xcEFt8W1hXHAAMAAQAAAAAAAAAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACAAAAAAQAA6EABQAOAAAJAjUJAQcRIREhESERAQQA/gD+AAIAAgCA/wD/AP8AAYABcgGN/nOiAY3+c5T+gAEA/wABgAEgAAAGAED/wAPAA8AAGQAhADkARwBVAGMAAAEuAScuAScuASMhIgYVERQWMyEyNjURNCYnJx4BFyM1HgETFAY
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"github.com/unidoc/unioffice/common"
"github.com/unidoc/unioffice/document"
@rikkix
rikkix / transform.go
Created October 16, 2020 13:30
golang png alpha channel issue
package hidden_test
import (
"image"
"image/color"
_ "image/jpeg"
"image/png"
"net/http"
"os"
"testing"