Skip to content

Instantly share code, notes, and snippets.

Avatar
🤑
working

L.T huyinghuan

🤑
working
View GitHub Profile
View docker-compose.yml
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 Sep 18, 2018
angular 5 input date component
View datepicker.ts
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 Sep 5, 2018 — forked from willshiao/aes.go
AES 256-CFB in Node.js and Golang
View aes.go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
View windows-startup-shortcut.vbs
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
View flex-layout.html
<html>
<head>
<style>
body{
height: 100%;
background-color: gray;
padding: 0px;
margin: 0px;
@huyinghuan
huyinghuan / random.go
Created Jul 17, 2017
random string with go
View random.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
golang encrypt with pkcs5 and pkcs7
View encrypt_file_pkcs5_pkcs7.go
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"errors"
"io"
"io/ioutil"
@huyinghuan
huyinghuan / crypt.js
Created May 31, 2017 — forked from esamson33/crypt.js
Node.js script to encrypt and decrypt an arbitrary string using 128-bit AES method in CFB mode
View crypt.js
/*!
* 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),
View encrypt_file.go
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
@huyinghuan
huyinghuan / index.go
Last active May 27, 2017
go文件上传
View index.go
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"mime/multipart"
"net/http"