Skip to content

Instantly share code, notes, and snippets.

View huyinghuan's full-sized avatar
🤑
working

L.T huyinghuan

🤑
working
View GitHub Profile
version: "2.0"
services:
gitlab:
image: gitlab/gitlab-ce:12.10.3-ce.0
container_name: gitlab
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://test.com'
ports:
@huyinghuan
huyinghuan / datepicker.ts
Created September 18, 2018 16:32
angular 5 input date component
import { Component, Input, OnInit, EventEmitter } from '@angular/core';
var template = `
<input type="date" [ngModel]="now | date:'yyyy-MM-dd'" (ngModelChange)="change($event)">
`
@Component({
selector: 'date-picker',
template: template,
outputs: ['dateChange']
@huyinghuan
huyinghuan / aes.go
Created September 5, 2018 00:49 — forked from willshiao/aes.go
AES 256-CFB in Node.js and Golang
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
set WshShell = WScript.CreateObject("WScript.Shell" )
Set FSO = CreateObject("Scripting.FileSystemObject")
strDesktop = WshShell.SpecialFolders("Startup" )
set oShellLink = WshShell.CreateShortcut(strDesktop & "\AutoUpdate.lnk" )
desktopDir = WshShell.SpecialFolders("Desktop")
oShellLink.TargetPath = FSO.BuildPath(desktopDir, "novel\AutoUpdate.exe")
oShellLink.WindowStyle = 1
oShellLink.WorkingDirectory = FSO.BuildPath(desktopDir, "novel")
oShellLink.Save
Msgbox "Startup Success",0
<html>
<head>
<style>
body{
height: 100%;
background-color: gray;
padding: 0px;
margin: 0px;
@huyinghuan
huyinghuan / random.go
Created July 17, 2017 13:41
random string with go
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456"
const (
letterIdxBits = 6 // 6 bits to represent a letter index
letterIdxMask = 1<<letterIdxBits - 1 // All 1-bits, as many as letterIdxBits
letterIdxMax = 63 / letterIdxBits // # of letter indices fitting in 63 bits
)
var src = rand.NewSource(time.Now().UnixNano())
func random(n int) string {
@huyinghuan
huyinghuan / encrypt_file_pkcs5_pkcs7.go
Created May 31, 2017 07:44
golang encrypt with pkcs5 and pkcs7
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"errors"
"io"
"io/ioutil"
@huyinghuan
huyinghuan / crypt.js
Created May 31, 2017 02:00 — forked from esamson33/crypt.js
Node.js script to encrypt and decrypt an arbitrary string using 128-bit AES method in CFB mode
/*!
* Node.js script to encrypt and decrypt an arbitrary string using
* 128-bit AES method in CFB mode.
*
*/
// A 16-byte key is required for a 128-bit encryption
var crypto = require('crypto'),
key = new Buffer('sixteen byte key'),
iv = crypto.randomBytes(16),
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
@huyinghuan
huyinghuan / index.go
Last active May 27, 2017 07:22
go文件上传
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"mime/multipart"
"net/http"