Skip to content

Instantly share code, notes, and snippets.

@kevinfu2
kevinfu2 / Aes128Ctr.cs
Created January 22, 2021 04:57 — forked from DamirLisak/Aes128Ctr.cs
A c# implementation of the aes counter mode encryption algorithm (aes ctr) based on the javascript version by Chris Veness https://gist.github.com/patches-76431/7483159
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
namespace aes
{
public static class ArrayExtensions
{
/// <summary>
@kevinfu2
kevinfu2 / mergeExcel.java
Created February 14, 2020 13:00 — forked from davidsommer/mergeExcel.java
Merge a List of Excel Files with POI Copies all Sheets, Fields of a List of Excel Files into a new one
public static void mergeExcelFiles(File file, List<FileInputStream> list) throws IOException {
HSSFWorkbook book = new HSSFWorkbook();
HSSFSheet sheet = book.createSheet(file.getName());
for (FileInputStream fin : list) {
HSSFWorkbook b = new HSSFWorkbook(fin);
for (int i = 0; i < b.getNumberOfSheets(); i++) {
copySheets(book, sheet, b.getSheetAt(i));
}
}
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@kevinfu2
kevinfu2 / customize_p.m
Created March 29, 2017 02:54
ME10批量打印脚本
DEFINE Atms_extract_basename
PARAMETER Input_path
PARAMETER Remove_extension
LOCAL Input_strlen
LOCAL Slash_posn
LOCAL Dot_posn
LOCAL Substring
LOCAL Path_sep
LOCAL Strlen
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.2
-- Dumped by pg_dump version 9.5.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
@kevinfu2
kevinfu2 / stock5Min.c
Last active August 29, 2015 14:16 — forked from border/stock5Min.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
struct stock5Min
{
unsigned short monthDay; // 月日
unsigned short hourMin; // 小时, 分钟