Skip to content

Instantly share code, notes, and snippets.

View staticor's full-sized avatar

SteveYagn staticor

View GitHub Profile
@staticor
staticor / get_data_mysql.sh
Created February 17, 2016 03:03
mysql retrieve data in Shell.
function run_Mysql()
{
mysql --default-character-set=utf8 \
-h 192.168.156.120 \
-u data -p'PIN239!@#$%^&8' \
-D optimus \
-e "
select platform, day
, SUM(bid) as bid , SUM(imp) as imp
@staticor
staticor / class_decorator.py
Created January 28, 2016 03:10 — forked from phith0n/class_decorator.py
class decorator
class Tx(object):
def __init__(self):
print("Tx:init")
self.something()
def something(self):
print("Tx:something")
def otherthing(self):
print("Tx:otherthing")
@fancellu
fancellu / ConsumerExample.scala
Last active November 28, 2024 13:00
Kafka Producer/Consumer Example in Scala
import java.util
import org.apache.kafka.clients.consumer.KafkaConsumer
import scala.collection.JavaConverters._
object ConsumerExample extends App {
import java.util.Properties
@ryandavidhartman
ryandavidhartman / BasicKafkaProcducer.scala
Last active June 10, 2021 12:39
A demonstration of the simplest Scala Kafka Producer
package com.example.basic
import java.util.Properties
import org.apache.kafka.clients.producer.{Callback, RecordMetadata, ProducerRecord, KafkaProducer}
import scala.concurrent.Promise
case class BasicProducer(topic: String, brokerList:String, sync: Boolean) {
val kafkaProps = new Properties()
@lucifr
lucifr / wubi_pinyin.emoji.dict.yaml
Last active March 18, 2021 16:45
Wubi Pinyin Extended Dictionary(emoji) for Rime
# Rime dictionary
# encoding: utf-8
#
# Wubi Pinyin Extended Dictionary(emoji) - 五笔拼音擴充詞庫(表情)
#
# by @lucifr
# based on https://gist.github.com/lembacon/4593540 & http://www.jianshu.com/p/ef2d9442fb0c
#
# 部署位置:
# ~/.config/ibus/rime (Linux)
@TheBB
TheBB / loading.org
Last active January 4, 2025 09:25
Loading in Spacemacs

Emacs packages, features, files, layers, extensions, auto-loading, require, provide, use-package… All these terms getting you confused? Let’s clear up a few things.

Files

Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.

One major problem is to ensure that all the correct files are loaded, and in the

@creeek
creeek / default.custom.yaml
Created April 20, 2015 06:30
Custom RIME
# ~/Library/Rime/default.custom.yaml
patch:
menu/page_size: 5
recognizer/patterns/yuncheng123: "^yuncheng[0-9]+$"
recognizer/patterns/yunchengime: "^yuncheng[-_.0-9]*$"
recognizer/patterns/xiang123: "^xiang[0-9]+$"
recognizer/patterns/xiangime: "^xiang[-_.0-9]*$"
recognizer/patterns/xuxiang123: "^xuxiang[0-9]+$"
recognizer/patterns/xuxiangime: "^xuxiang[-_.0-9]*$"
@goxofy
goxofy / Karabiner_Private_For_Filco_Minila.xml
Last active April 23, 2024 09:19
Karabiner 备份 For Filco Minila
<?xml version="1.0"?>
<root>
<!-- 设备定义 -->
<devicevendordef>
<vendorname>FILCO</vendorname>
<vendorid>0x0a5c</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>MINILA_KEYBOARD</productname>
@JinnLynn
JinnLynn / taobao.py
Last active September 16, 2020 03:03
淘宝消费情况统计
# -*- coding: utf-8 -*-
"""淘宝消费情况统计
使用方法:
python taobao.py -u USERNAME -p PASSWORD -s START-DATE -e END-DATE --verbose
所有参数均可选,如:
python taobao.py -u jinnlynn
统计用户jinnlynn所有订单的情况
@jcouyang
jcouyang / why-curry-helps.md
Last active February 20, 2023 21:09
为什么要柯里化(why-curry-helps)slide http://git.io/why-curry-helps 📈

还记得 Haskell Curry吗,

多巧啊, 人家姓 Curry 名 Haskell, 难怪 Haskell 语言会自动柯里化, 呵呵. 但是不奇怪吗, 为什么要柯里化呢. 为什么如此重要导致 Haskell 会默认自动柯里化所有函数, 不就是返回一个部分配置好的函数吗.

我们来看一个 Haskell 的代码.

max 3 4
(max 3) 4