Skip to content

Instantly share code, notes, and snippets.

View gythialy's full-sized avatar
🎯
Focusing

Goren G gythialy

🎯
Focusing
View GitHub Profile
@gythialy
gythialy / DeepCopy.java
Last active December 16, 2015 15:59
DeepCopy object
package com.clone;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import org.nutz.castor.Castors;
public class DeepCopy {
package com.clone;
import java.io.InputStream;
public class FastByteArrayInputStream extends InputStream {
/**
* Our byte buffer
*/
protected byte[] buf = null;
@gythialy
gythialy / gson.java
Last active July 11, 2021 07:30
Gson support Guava MutiMap and Table
package com.wescon.cv.utilities;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.nutz.castor.Castors;
@gythialy
gythialy / LicenseEngine.cs
Last active June 13, 2022 02:50
remove license validation of MarkdownPad 2 by Mono Cecil
public bool VerifyLicense(string licenseKey, string email)
{
if (string.IsNullOrEmpty(licenseKey) || string.IsNullOrEmpty(email))
{
return false;
}
try
{
this.License = this.Decrypt(licenseKey);
this.LicenseProcessed = true;
@gythialy
gythialy / jpg2pdf.cs
Created January 19, 2014 04:03
convert jpg to pdf by c#
void ConvertJPG2PDF(string jpgfile, string pdf)
{
var document = new Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
using (var stream = new FileStream(pdf, FileMode.Create, FileAccess.Write, FileShare.None))
{
PdfWriter.GetInstance(document, stream);
document.Open();
using (var imageStream = new FileStream(jpgfile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
var image = Image.GetInstance(imageStream);
# See: https://github.com/arantius/karma-blocker/wiki/Configuration
[Settings]
threshold=12
cutoff=12
collapse=false
[Inject]
function='COMSCORE'
function='DM_tag'
function='GA_googleAddAttr'
!-----------------------------------------------------------------------------------
!*headbegin
!*title=第三方视频广告过滤规则
!*author=红新月
!*lastmodify=2014-04-06 14:14:24
!*head
! 修改IQIYI广告CID参数
@gythialy
gythialy / DirectoryScanner.java
Last active August 29, 2015 14:09
DirectoryScanner
package com.wescon;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Sets.newLinkedHashSet;
import java.io.File;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-/Apple/DTD PLIST 1.0/EN" "http:/www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.shadowsocks.chinadns</string>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import java.lang.reflect.Field;
import java.nio.ByteOrder;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Comparator;
import sun.misc.Unsafe;