Skip to content

Instantly share code, notes, and snippets.

View hamxiaoz's full-sized avatar

Andrew Zheng hamxiaoz

View GitHub Profile
@hamxiaoz
hamxiaoz / isxdl.cs
Last active February 17, 2016 23:34
How to use [isxdl.dll](http://woohaeng.com.ne.kr/docs/isxdl.htm) to download files in C#?
[DllImport("isxdl.dll")]
static extern Int32 isxdl_Download(IntPtr hWndParent, String pszURL, String pszFileName);
[DllImport("isxdl.dll")]
static extern Int32 isxdl_SetOption(String option, String value);
private void button_download_Click(object sender, EventArgs e)
{
var fileUrl = "REPLACE_ME";
@hamxiaoz
hamxiaoz / crontab
Last active March 8, 2016 17:54
Use git to backup MongoDB for Meteor
# run every day at 12am
00 00 * * * /home/x/run_backup.sh
@NgModuel({
imports: [], // Import other module
declarations: [], // The components, directives and pipe belong to this module
providers: [], // Provide service (class name) that's defined in **this** module. External service is not needed here.
exports: [], // Export **declarable** classes so that other module can use. This is the public API of the component..
entryComponents: [], // A list of components that are not referenced in a reachable component template in this moodule.
bootstrap: [] // Usually root component.
})
export class AppModule { }
@hamxiaoz
hamxiaoz / point-free.ts
Last active February 22, 2018 00:39
Point free style in TypeScript
interface Transaction {
amount: number;
}
class Test {
private const BIG_AMOUNT = 10;
public getPositiveTransactions(transactions: Transaction[]) {
// point free
return transactions.filter(this.isPositive);