Skip to content

Instantly share code, notes, and snippets.

View ice1000's full-sized avatar
♾️
Generalizing something

Tesla Zhang‮ ice1000

♾️
Generalizing something
View GitHub Profile
@ice1000
ice1000 / coping-alpha-of-intellij-icon.kt
Created March 29, 2017 16:51
it makes an icon's alpha value the same as intellij's one's. (I used it to make intellij plugin icon)
import java.io.File
import javax.imageio.ImageIO
/**
* Created by ice1000 on 2017/3/28.
*
* @author ice1000
*/
@ice1000
ice1000 / sb.go
Created January 1, 2017 16:46
Java-like StringBuffer for Golang
package sb
import (
"fmt"
"strings"
)
const maxLength = 150
/// a java style string buffer
@ice1000
ice1000 / C++JniGeneration.kt
Created December 20, 2016 07:33
Using Kotlin to generate JNI C++ codes for my own use
@file:JvmMultifileClass
@file:JvmName("CodeGen")
package org.algo4j.gen
import org.algo4j.test.print
/**
* Created by ice1000 on 2016/12/6.
*
// 不得不说,虽然是个水题,但是还是应该保证内存安全,按照@Yoto Chang的说法。于是我就写了一个内存安全的。
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
double **a;
int *x, *y;
int squared (int x) {
@ice1000
ice1000 / LanguageExtension.kt
Created August 20, 2016 00:33
Some interesting language extension in kotlin
package org.frice.game.utils.kotlin
/**
* Kotlin language extension
* for Kotlin only
*
*
* Created by ice1000 on 2016/8/17.
* @author ice1000
* @since v0.3.2