Skip to content

Instantly share code, notes, and snippets.

@tanyuan
tanyuan / fcitx-chewing.png
Last active August 19, 2024 22:42
Ubuntu: fcitx + chewing 新酷音輸入法
fcitx-chewing.png
public void updateList(ArrayList<Person> newList) {
DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(new MyDiffCallback(this.persons, newList));
diffResult.dispatchUpdatesTo(this);
}
public class MyDiffCallback extends DiffUtil.Callback{
List<Person> oldPersons;
List<Person> newPersons;
public MyDiffCallback(List<Person> newPersons, List<Person> oldPersons) {
this.newPersons = newPersons;
this.oldPersons = oldPersons;
}
@rafaelsc
rafaelsc / VisualStudio.flt
Created May 6, 2015 22:07
WinMerge Directory/File Filter for Visual Studio temporary files, build results, and files generated by popular Visual Studio add-ons.
## by rafaelsc
## This is a directory/file filter for WinMerge
## This filter Ignore Visual Studio temporary files, build results, and files generated by popular Visual Studio add-ons
name: Visual Studio Files
desc: Ignore Visual Studio temporary files, build results, and files generated by popular Visual Studio add-ons.
## This is an inclusive (loose) filter
## (it lets through everything not specified)
def: include
@timabell
timabell / xml-doc.tt
Created January 16, 2015 19:46
t4 snippet for adding xml doc from .edmx
// heavily modified version of http://forums.asp.net/t/2011994.aspx
...
WriteLine("");
WriteDocumentation(entity.Documentation);#>
...
WriteDocumentation(edmProperty.Documentation, CurrentIndent);
...
WriteDocumentation(complexProperty.Documentation);
...
@sandromello
sandromello / Zimbra Token Soap API
Last active January 17, 2022 06:33
Get Zimbra Token Soap API Example in C#
// Tested with version 8.0.6
// Read more at http://wiki.zimbra.com/wiki/SOAP_API_Reference_Material_Beginning_with_ZCS_8.0#ZCS_8.0.6
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
using System.Security.Cryptography.X509Certificates;
@eternnoir
eternnoir / gist:9777420
Last active May 3, 2022 05:25
Ftp Client With C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
namespace Lib.Common
{
public class FtpClient
@Gozala
Gozala / go.js
Created October 31, 2013 00:08
Go routines for JS
// Utility function for detecting generators.
let isGenerator = x => {
return Function.isGenerator &&
Function.isGenerator.call(x)
}
// Data type represents channel into which values
// can be `put`, or `received` from. Channel is
// very much like queue where reads and writes are
// synchronized via continuation passing.
@monperrus
monperrus / MethodCallCollector.java
Created November 10, 2011 11:22
Static analysis to extract method calls
/**
* This program makes a static analysis in
* order to extract method calls of a directory containing Java bytecode .
*
* It uses the Soot library.
*
* Usage:
* 1. Change the classpath and the directoryToAnalyze variable
* 2. run java -cp bin:soot.jar mm.soot.MethodCallCollector
* 3. look at /tmp/data.dat