Skip to content

Instantly share code, notes, and snippets.

View Garlandal's full-sized avatar
🎯
Focusing

Garland Garlandal

🎯
Focusing
View GitHub Profile
@TsingJyujing
TsingJyujing / HBaseRichOutputFormat.java
Last active July 7, 2020 08:50
Flink持久化踩坑笔记代码
import com.google.common.collect.Lists;
import org.apache.flink.api.common.io.RichOutputFormat;
import org.apache.flink.configuration.Configuration;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Table;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@arno-di-loreto
arno-di-loreto / openapi_specification_fka_swagger_specification_tutorial.md
Last active May 5, 2022 13:46
OpenAPI Specification (fka Swagger Specification) tutorial files from [API Handyman blog](http://apihandyman.io)
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 18, 2024 18:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@neilwong2012
neilwong2012 / sh
Last active September 29, 2016 10:45
file recover
一个终端(记为A):
# [07/06 19:16:15] xenon@ribosome ~ $
touch delete-me
# [07/06 19:16:22] xenon@ribosome ~ $
vim delete-me
写进去一行字,作为内容。
另一个终端(记为B)打开文件:
@sadikovi
sadikovi / CollectionUDAF.scala
Last active June 12, 2020 11:05
UDAF for generating collection of values (for a specific limit)
import org.apache.spark.sql.Row
import org.apache.spark.sql.expressions.{MutableAggregationBuffer, UserDefinedAggregateFunction}
import org.apache.spark.sql.types.{ArrayType, LongType, DataType, StructType, StructField}
class CollectionFunction(private val limit: Int) extends UserDefinedAggregateFunction {
def inputSchema: StructType =
StructType(StructField("value", LongType, false) :: Nil)
def bufferSchema: StructType =
StructType(StructField("list", ArrayType(LongType, true), true) :: Nil)
@gvolpe
gvolpe / ParseUrlParameters.scala
Created September 14, 2015 14:26
Parse URL Parameters
import java.net.URLDecoder
def parseUrlParameters(url: String) = {
url.split("&").map( v => {
val m = v.split("=", 2).map(s => URLDecoder.decode(s, "UTF-8"))
m(0) -> m(1)
}).toMap
}
@lvzongting
lvzongting / Mac os 打印驱动 for linux
Created October 27, 2014 03:28
很多打印机只提供Mac os 打印驱动, 因为linux和Mac os 都使用的是标准的Unix 通用打印系统,所以提取Mac OS下的驱动ppd文件即可在linux使用打印机了。
Mac os 打印驱动 for linux
很多打印机只提供Mac os 打印驱动, 因为linux和Mac os 都使用的是标准的Unix 通用打印系统,所以提取Mac OS下的驱动ppd文件即可在linux使用打印机了。这里只是记录了一个方法,为了方便大家使用,我正在寻找一个网络空间可以将我提取出来的这些ppd驱动文件上传上去提供大家下载,可能还会提供一个便于检索的网页,如果大家有需要什么打印驱动的话,可以在这个gist后面留言。
当然,我也会积极的将这些文件进行打包,然后丢到各大软件源中。以方便大家的使用。
真心希望,linux这样好用的系统能快速发展,普及,能让更多的人感受到使用linux的快乐。
苹果系统 Mac OS 打印驱动用在linux系统。(通过cups 通用Unix打印系统ppd格式化文件驱动打印机)
@codesplicer
codesplicer / app.py
Created November 9, 2012 12:56
flask-mongoengine in a blueprint
# Flask related imports
from flask import Flask, render_template, jsonify, abort, request, make_response, session, redirect, url_for
# Flask extensions
from flask.ext.mongoengine import MongoEngine
from flask_debugtoolbar import DebugToolbarExtension
# Flask blueprints
import companies
from companies.views import companies
@n1ywb
n1ywb / retries.py
Created May 1, 2012 17:48
A Python function retrying decorator
#!/usr/bin/env python
#
# Copyright 2012 by Jeff Laughlin Consulting LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@lucifr
lucifr / gist:1208100
Created September 10, 2011 08:16
Sublime Text 2 - 实用快捷键 (Mac OS X)