Skip to content

Instantly share code, notes, and snippets.

@a9
a9 / trial.key
Created June 25, 2021 09:24 — forked from huqi/trial.key
Beyond Compare 4 license for Mac
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
@a9
a9 / appendBlur.swift
Created February 18, 2020 11:19 — forked from 0xWDG/appendBlur.swift
Append Blur to a NSView, NSButton, NSTextField
//
// appendBlur.swift
//
// Created by Wesley de Groot on 09-07-16.
// Copyright © 2016 Wesley de Groot. All rights reserved.
//
import Foundation
enum blur: String {
case light = "light"
@a9
a9 / chrome-dark.css
Created June 16, 2019 02:37
chrome prefers-color-scheme dark
@media (prefers-color-scheme: dark) {
body {
color: white;
background-color: black;
}
}
@a9
a9 / vue-typescript-component.vue
Last active May 30, 2019 13:59
Vue Typescript Component File Template as WebStorm #vue
#set( $ClassName = "${Prefix}-${NAME}" )
#set( $ComponentNamePrefix = ${StringUtils.removeAndHump(${Prefix}, "-")} )
#set( $ComponentName = ${StringUtils.removeAndHump(${NAME}, "-")} )
<template>
<div class="${ClassName}">#[[$END$]]#</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
@a9
a9 / effective-graphql-and-antd.md
Created September 12, 2018 07:41
Effective GraphQL + Antd

高效的 GraphQL + Antd

本文原载于我的独立博客 https://lutaonan.com/blog/effective-graphql-and-antd/

在过去的几年,不论是面向内部的系统,还是面向外部的产品,我们都大量地使用了 Ant.Design —— 一个基于 React 的 UI 组件库。

在做内部系统时,Ant.Design 解决了几乎 60% 的问题。剩下的问题在业务逻辑和代码组织的复杂度。我见过很多内部系统因为滥用状态管理而使代码变得复杂,他们之所以使用状态管理库,并不是因为应用的状态复杂,而是因为需要一个状态树来管理网络请求的状态、接口返回的数据等等这些和接口相关的状态。

真的需要状态管理库吗?在之前,我没有信心回答这个问题。但在使用了 GraphQL (Apollo) 后,我确信,在大多数场景,你不再需要状态管理。

@a9
a9 / compress.go
Created May 11, 2018 06:13 — forked from iamralch/compress.go
ZIP archives in Golang
import (
"archive/zip"
"io"
"os"
"path/filepath"
"strings"
)
func zipit(source, target string) error {
zipfile, err := os.Create(target)
@a9
a9 / CreateJob.sh
Created April 24, 2018 08:35 — forked from stuart-warren/CreateJob.sh
Create a job in Jenkins (or folder) using the HTTP API
# check if job exists
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken
# with folder plugin
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# without folder plugin
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# create folder
@a9
a9 / nginx.conf
Created July 25, 2017 15:59 — forked from micho/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
@a9
a9 / DDSImageParser.cs
Created December 9, 2016 04:57 — forked from soeminnminn/DDSImageParser.cs
Read DDS image in C# way. Converted from "[il_dds.c](https://github.com/DentonW/DevIL/blob/master/DevIL/src-IL/src/il_dds.c)" (DevIL).
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.IO;
namespace S16.Drawing
{
#region DDSImage Class
@a9
a9 / buildandroid.sh
Created July 25, 2016 07:57
buildandroid.sh
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/