Skip to content

Instantly share code, notes, and snippets.

View gembin's full-sized avatar
🎯
Focusing

gembin

🎯
Focusing
  • Seattle, WA
View GitHub Profile
@gembin
gembin / 词性标记.md
Created November 25, 2018 07:26 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名

@gembin
gembin / revert-a-commit.md
Created September 27, 2018 15:30 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

# Java
*.class
*.jar
*.war
*.ear
# Eclipse
.project
.classpath
.settings
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@gembin
gembin / KerasModelImportExample.java
Created July 10, 2018 07:58 — forked from turambar/KerasModelImportExample.java
Examples of DL4J's Keras model import syntax (assumes Keras Functional API models and DL4J ComputationGraph)
package org.deeplearning4j.nn.modelimport.keras;
import org.deeplearning4j.nn.api.Layer;
import org.deeplearning4j.nn.conf.ComputationGraphConfiguration;
import org.deeplearning4j.nn.graph.ComputationGraph;
import org.deeplearning4j.nn.multilayer.MultiLayerNetwork;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@gembin
gembin / git-merge-commits.md
Last active October 2, 2020 15:09
Git merge commits into one

Interactively

git rebase --interactive HEAD~2
pick bf7416a commit-2
pick fbc0ef9 commit-3
@gembin
gembin / git-branch-simplify.md
Created June 6, 2018 06:49 — forked from datagrok/git-branch-simplify.md
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@gembin
gembin / ca.md
Created May 12, 2018 08:50 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@gembin
gembin / rsa_private_public_key.md
Last active March 6, 2024 10:36
Use RSA private key to generate public key?

To encrypt something using RSA algorithm you need modulus and encryption (public) exponent pair (n, e). That's your public key. To decrypt something using RSA algorithm you need modulus and decryption (private) exponent pair (n, d). That's your private key.

To encrypt something using RSA public key you treat your plaintext as a number and raise it to the power of e modulus n:

ciphertext = ( plaintext^e ) mod n

To decrypt something using RSA private key you treat your ciphertext as a number and raise it to the power of d modulus n:

plaintext = ( ciphertext^d ) mod n
@gembin
gembin / set_jdk_mac.md
Last active April 8, 2018 03:08
Switching JDK on Mac OS X

/usr/libexec/java_home -V command to get the list of installed JDKs.

For example:

Matching Java Virtual Machines (2):
    9.0.4, x86_64:	"Java SE 9.0.4"	/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
    1.8.0_161, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home