Skip to content

Instantly share code, notes, and snippets.

View dalei2019's full-sized avatar
🎯
Focusing

dalei2019 dalei2019

🎯
Focusing
View GitHub Profile
def split(): Unit = {
import org.apache.spark.SparkConf
import org.ansj.library.DicLibrary
import org.ansj.splitWord.analysis.DicAnalysis
import org.apache.spark.sql.{SaveMode, SparkSession}
val conf = new SparkConf().setAppName("HelloWorld")
val spark = SparkSession
.builder()
@dalei2019
dalei2019 / word2vecAPI.py
Last active November 29, 2019 01:59
python word2vec api demo
import json
from flask import Flask, request
from gensim.models import KeyedVectors
from flask import jsonify
import argparse
import sys
import socket
import time
import logging
@dalei2019
dalei2019 / iterm2-send-zmodem.sh
Last active April 13, 2023 17:49
iterm2 send zmodem clone from [email protected]
#!/bin/bash
# Author: Matt Mastracci ([email protected])
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domain
osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; then
FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
else
@dalei2019
dalei2019 / iterm2-recv-zmodem.sh
Last active April 13, 2023 17:49
iterm2 recv zmodem clone from [email protected]
#!/bin/bash
# Author: Matt Mastracci ([email protected])
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domain
osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; then
FILE=$(osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")")
else