Datasets:
code stringlengths 1 1.05M | repo_name stringlengths 4 119 | path stringlengths 1 265 | language stringclasses 304
values | license stringclasses 27
values | size int64 1 1.05M |
|---|---|---|---|---|---|
FROM ruby:2.5.3-alpine
RUN apk add --no-cache autoconf
RUN apk add --no-cache libtool
RUN apk add --no-cache libcap-dev
RUN apk add --no-cache pcre-dev
RUN apk add --no-cache curl
RUN apk add --no-cache build-base
RUN apk add --no-cache ncurses-dev
RUN apk add --no-cache tmux
WORKDIR /zsh-autosuggestions
ADD ZSH_VER... | zsh/zsh-autosuggestions | Dockerfile | Dockerfile | mit | 563 |
source 'https://rubygems.org'
gem 'rspec'
gem 'rspec-wait'
gem 'pry-byebug'
| zsh/zsh-autosuggestions | Gemfile | Ruby | mit | 77 |
SRC_DIR := ./src
SRC_FILES := \
$(SRC_DIR)/config.zsh \
$(SRC_DIR)/util.zsh \
$(SRC_DIR)/bind.zsh \
$(SRC_DIR)/highlight.zsh \
$(SRC_DIR)/widgets.zsh \
$(SRC_DIR)/strategies/*.zsh \
$(SRC_DIR)/fetch.zsh \
$(SRC_DIR)/async.zsh \
$(SRC_DIR)/start.zsh
HEADER_FILES := \
DESCRIPTION \
URL \
VERSION \
LICEN... | zsh/zsh-autosuggestions | Makefile | Makefile | mit | 682 |
#!/bin/sh
set -ex
for v in $(grep "^[^#]" ZSH_VERSIONS); do
mkdir zsh-$v
cd zsh-$v
curl -L https://api.github.com/repos/zsh-users/zsh/tarball/zsh-$v | tar xz --strip=1
./Util/preconfig
./configure --enable-pcre \
--enable-cap \
--enable-multibyte \
--with-term-lib... | zsh/zsh-autosuggestions | install_test_zsh.sh | Shell | mit | 503 |
require 'pry'
require 'rspec/wait'
require 'terminal_session'
require 'tempfile'
RSpec.shared_context 'terminal session' do
let(:term_opts) { {} }
let(:session) { TerminalSession.new(term_opts) }
let(:before_sourcing) { -> {} }
let(:after_sourcing) { -> {} }
let(:options) { [] }
around do |example|
be... | zsh/zsh-autosuggestions | spec/spec_helper.rb | Ruby | mit | 1,189 |
shared_examples 'special characters' do
describe 'a special character in the buffer should be treated like any other character' do
it 'asterisk' do
with_history('echo "hello*"', 'echo "hello."') do
session.send_string('echo "hello*')
wait_for { session.content }.to eq('echo "hello*"')
... | zsh/zsh-autosuggestions | spec/strategies/special_characters_helper.rb | Ruby | mit | 2,113 |
require 'securerandom'
class TerminalSession
ZSH_BIN = ENV['TEST_ZSH_BIN'] || 'zsh'
def initialize(opts = {})
opts = {
width: 80,
height: 24,
prompt: '',
term: 'xterm-256color',
zsh_bin: ZSH_BIN
}.merge(opts)
@opts = opts
cmd="PS1=\"#{opts[:prompt]}\" TERM=#{opts[:t... | zsh/zsh-autosuggestions | spec/terminal_session.rb | Ruby | mit | 1,753 |
#--------------------------------------------------------------------#
# Async #
#--------------------------------------------------------------------#
_zsh_autosuggest_async_request() {
zmodload zsh/system 2>/dev/null # For `$sysparams`
typeset -g _ZSH_... | zsh/zsh-autosuggestions | src/async.zsh | Shell | mit | 2,551 |
#--------------------------------------------------------------------#
# Widget Helpers #
#--------------------------------------------------------------------#
_zsh_autosuggest_incr_bind_count() {
typeset -gi bind_count=$((_ZSH_AUTOSUGGEST_BIND_COUNTS[$1]+1))
_ZS... | zsh/zsh-autosuggestions | src/bind.zsh | Shell | mit | 3,366 |
#--------------------------------------------------------------------#
# Global Configuration Variables #
#--------------------------------------------------------------------#
# Color to use when highlighting suggestion
# Uses format of `region_highlight`
# More info: http://zsh.s... | zsh/zsh-autosuggestions | src/config.zsh | Shell | mit | 2,719 |
#--------------------------------------------------------------------#
# Fetch Suggestion #
#--------------------------------------------------------------------#
# Loops through all specified strategies and returns a suggestion
# from the first strategy to provide one... | zsh/zsh-autosuggestions | src/fetch.zsh | Shell | mit | 816 |
#--------------------------------------------------------------------#
# Highlighting #
#--------------------------------------------------------------------#
# If there was a highlight, remove it
_zsh_autosuggest_highlight_reset() {
typeset -g _ZSH_AUTOSUGGEST_L... | zsh/zsh-autosuggestions | src/highlight.zsh | Shell | mit | 896 |
#--------------------------------------------------------------------#
# Start #
#--------------------------------------------------------------------#
# Start the autosuggestion widgets
_zsh_autosuggest_start() {
# By default we re-bind widgets on every p... | zsh/zsh-autosuggestions | src/start.zsh | Shell | mit | 1,360 |
#--------------------------------------------------------------------#
# Completion Suggestion Strategy #
#--------------------------------------------------------------------#
# Fetches a suggestion from the completion engine
#
_zsh_autosuggest_capture_postcompletion() {
# Always... | zsh/zsh-autosuggestions | src/strategies/completion.zsh | Shell | mit | 4,580 |
#--------------------------------------------------------------------#
# History Suggestion Strategy #
#--------------------------------------------------------------------#
# Suggests the most recent history item that matches the given
# prefix.
#
_zsh_autosuggest_strategy_hist... | zsh/zsh-autosuggestions | src/strategies/history.zsh | Shell | mit | 1,239 |
#--------------------------------------------------------------------#
# Match Previous Command Suggestion Strategy #
#--------------------------------------------------------------------#
# Suggests the most recent history item that matches the given
# prefix and whose preceding history item a... | zsh/zsh-autosuggestions | src/strategies/match_prev_cmd.zsh | Shell | mit | 2,313 |
#--------------------------------------------------------------------#
# Utility Functions #
#--------------------------------------------------------------------#
_zsh_autosuggest_escape_command() {
setopt localoptions EXTENDED_GLOB
# Escape special chars in the st... | zsh/zsh-autosuggestions | src/util.zsh | Shell | mit | 401 |
#--------------------------------------------------------------------#
# Autosuggest Widget Implementations #
#--------------------------------------------------------------------#
# Disable suggestions
_zsh_autosuggest_disable() {
typeset -g _ZSH_AUTOSUGGEST_DISABLED
_zsh_autosugges... | zsh/zsh-autosuggestions | src/widgets.zsh | Shell | mit | 5,414 |
source ${0:A:h}/zsh-autosuggestions.zsh
| zsh/zsh-autosuggestions | zsh-autosuggestions.plugin.zsh | Shell | mit | 40 |
# Fish-like fast/unobtrusive autosuggestions for zsh.
# https://github.com/zsh-users/zsh-autosuggestions
# v0.7.0
# Copyright (c) 2013 Thiago de Arruda
# Copyright (c) 2016-2021 Eric Freese
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
... | zsh/zsh-autosuggestions | zsh-autosuggestions.zsh | Shell | mit | 26,911 |
#!/bin/bash
# Print the script usage
print_usage() {
echo -e "Usage: $0 [-n namespace] [-r release] [-L | -l app(s)] [-s since | -t timestamp ] [-m maxloglines] [-p] [-w log_timeout]\n"
exit 1
}
# Generic 'fail' function, report and exit
fail() {
echo -e "\nFAIL: $*\n" >&2
exit 1
}
# Print error messages... | rzhu_projects/toolbox/kubesos | kubeSOS.sh | Shell | unknown | 13,009 |
package io.devops
def MavenBuild(){
container('maven'){
script {
sh 'mvn package -DskipTests -Dmaven.javadoc.skip=true -Dmaven.site.skip=true -Dmaven.source.skip=true -Djacoco.skip=true -Dcheckstyle.skip=true -Dfindbugs.skip=true -Dpmd.skip=true -Dfabric8.skip=true -e -B'
}
}
}
... | dogger/share-library | src/io/devops/build.groovy | Groovy | apache-2.0 | 1,223 |
package io.devops
def DeployK8s(){
container("maven"){
writeFile file:'deploy-sample.yaml', text:libraryResource("deploy/yaml")
sh "cat deploy-sample.yaml"
withKubeConfig([credentialsId: "dev-kubeconfig"]){
sh "kubectl apply -f -"
... | dogger/share-library | src/io/devops/deploy.groovy | Groovy | apache-2.0 | 366 |
package io.devops;
def getCode(srcUrl, branchName){
echo 'code init.....'
checkout([$class: 'GitSCM',
branches: [[name: "${branchName}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [
[
$class: 'CloneOption',
... | dogger/share-library | src/io/devops/git.groovy | Groovy | apache-2.0 | 654 |
package io.devops
def init(){
properties([
parameters([
string(defaultValue:'devops-java-sample', description:'应用名称', name: 'appName',trim: true, required: true ),
string(defaultValue:'https://github.com/Feeeenng/devops-java-sample.git', description:'应用git地址', name: 'srcUrl',trim: t... | dogger/share-library | src/io/devops/params.groovy | Groovy | apache-2.0 | 710 |
package io.devops
//格式化输出
def PrintMes(value,color){
colors = ['red' : "\033[40;31m >>>>>>>>>>>${value}<<<<<<<<<<< \033[0m",
'blue' : "\033[47;34m ${value} \033[0m",
'green' : "[1;32m>>>>>>>>>>${value}>>>>>>>>>>[m",
'green1' : "\033[40;32m >>>>>>>>>>>${value}<<<<<<<<<... | dogger/share-library | src/io/devops/tools.groovy | Groovy | apache-2.0 | 408 |
package io.devops
def MavenTest(){
container ('maven') {
// 单元 测试
sh 'mvn clean -o -gs `pwd`/configuration/settings.xml test'
}
// 生成 测试报告 todo
}
def main(){
if("${buildType}" == 'java'){
MavenTest()
}else {
echo 'pass'
}
}
| dogger/share-library | src/io/devops/unit.groovy | Groovy | apache-2.0 | 317 |
module.exports = {
reactStrictMode: true,
}
| lpeng1991/qingyun | next.config.js | JavaScript | unknown | 46 |
import '../styles/globals.css'
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
export default MyApp
| lpeng1991/qingyun | pages/_app.js | JavaScript | unknown | 137 |
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default function handler(req, res) {
res.status(200).json({ name: 'John Doe' })
}
| lpeng1991/qingyun | pages/api/hello.js | JavaScript | unknown | 170 |
#!/var/lang/node12/bin/node
const { nextStart } = require('next/dist/cli/next-start');
nextStart([ '--port', '9000', '--hostname', '0.0.0.0' ])
| lpeng1991/qingyun | scf_bootstrap | JavaScript | unknown | 145 |
.container {
min-height: 100vh;
padding: 0 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
}
.main {
padding: 5rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.footer {
width:... | lpeng1991/qingyun | styles/Home.module.css | CSS | unknown | 1,808 |
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}
| lpeng1991/qingyun | styles/globals.css | CSS | unknown | 275 |
pub mod sort;
pub use sort::*;
| rickiey/rs | src/algorithm/mod.rs | Rust | unknown | 32 |
pub fn sort_bin() {
let mut rse:Vec<i32> = vec![2,5,7,8,1,2,7,3,8,6,-1];
let mut v2 :Vec<i32> = vec![7,7,3,2,6];
println!("{:?}", rse.append(&mut v2))
}
| rickiey/rs | src/algorithm/sort/binary.rs | Rust | unknown | 166 |
pub mod binary;
pub mod quick;
| rickiey/rs | src/algorithm/sort/mod.rs | Rust | unknown | 31 |
pub fn use_quick_sort(){
let mut rse:Vec<i32> = vec![2,5,7,8,1,2,7,3,8,6,-1];
quick_sort(&mut rse);
println!("{:?}", rse)
}
pub fn quick_sort<T: Ord>(arr: &mut [T]) {
let len = arr.len();
_quick_sort(arr, 0, (len - 1) as isize);
}
fn _quick_sort<T: Ord>(arr: &mut [T], low: isize, high: isize) ... | rickiey/rs | src/algorithm/sort/quick.rs | Rust | unknown | 1,135 |
use std::collections::HashMap;
pub fn use_vec() {
let v = vec![1, 23, 4];
for i in v.iter() {
println!("{}", i);
}
let mut vv: Vec<&str> = vec!["a", "b", "c"];
vv[2] = "vvvv";
println!(
"{:?} {}",
match vv.get(3) {
None => "",
_ => vv.get(3).unwr... | rickiey/rs | src/collections/coll.rs | Rust | unknown | 1,231 |
pub mod coll;
| rickiey/rs | src/collections/mod.rs | Rust | unknown | 14 |
#[derive(Debug)]
pub enum IpAddrKid {
Loop,
V4(String),
V6(String),
}
impl IpAddrKid {
pub fn print_ip(self) {
match self {
IpAddrKid::V4(s4) => {
println!("{:?}", s4);
}
IpAddrKid::V6(s6) => {
println!("{:?}", s6);
... | rickiey/rs | src/enume/enumerate.rs | Rust | unknown | 1,567 |
pub mod enumerate;
pub fn super_fn() {
println!("super fn");
}
| rickiey/rs | src/enume/mod.rs | Rust | unknown | 68 |
extern crate serde;
extern crate serde_json;
use serde_json::Value as jsonValue;
#[derive(Serialize, Deserialize, Debug)]
pub struct Res {
#[serde(rename(serialize = "code", deserialize = "code"))]
Code: String,
}
pub fn use_serde_json() {
let json_raw = r#"{"code":"ok"}"#;
let res: jsonValue = ser... | rickiey/rs | src/extern_lib/json_parse.rs | Rust | unknown | 665 |
pub mod json_parse;
pub mod req;
| rickiey/rs | src/extern_lib/mod.rs | Rust | unknown | 33 |
extern crate reqwest;
use std::error;
// use reqwest;
pub fn use_reqwest() -> Result<i32, reqwest::Error> {
// let b = blocking::get("http://localhost:9090/").text();
//
// println!("{:?}", b);
// let body = reqwest::blocking::get("http://localhost:9090/")?.text()?;
let resp = reqwest::blockin... | rickiey/rs | src/extern_lib/req.rs | Rust | unknown | 420 |
pub mod print_std;
| rickiey/rs | src/fmt_print/mod.rs | Rust | unknown | 19 |
pub fn prints() {
println!("{0} {a1}", "args02", a1 = "args01");
let s = "2".parse::<f64>().unwrap();
println!("{} {1}", 3.to_string(), s);
println!("{} {:?}", "args02", "args01".to_string());
println!("{number:>width$}", number = 1, width = 6);
println!("{number:0>w$}", number = 1, w = 6);
}
| rickiey/rs | src/fmt_print/print_std.rs | Rust | unknown | 318 |
pub fn test_001() {
println!("{}", max_area(vec![2, 5, 1, 6, 7, 3, 8]))
}
/*
给你 n 个非负整数 a1,a2,...,an,每个数代表坐标中的一个点 (i, ai) 。在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0) 。找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。
说明:你不能倾斜容器。
示例 1:
输入:[1,8,6,2,5,4,8,3,7]
输出:49
解释:图中垂直线代表输入数组 [1,8,6,2,5,4,8,3,7]。在此情况下,容器能够容纳水(表示为蓝色部分)... | rickiey/rs | src/leet_code/container_moster_water.rs | Rust | unknown | 1,383 |
pub mod container_moster_water;
| rickiey/rs | src/leet_code/mod.rs | Rust | unknown | 32 |
mod algorithm;
mod collections;
mod enume;
mod extern_lib;
mod fmt_print;
mod leet_code;
mod mysqlcli;
mod strt;
mod struct_trait;
#[macro_use]
extern crate serde_derive;
use crate::algorithm::sort;
#[warn(unused_imports)]
use crate::strt::sstring::*;
use collections::coll;
use fmt_print::print_std::prints as ps;
use... | rickiey/rs | src/main.rs | Rust | unknown | 2,307 |
pub mod mycli;
| rickiey/rs | src/mysqlcli/mod.rs | Rust | unknown | 15 |
use std::str::FromStr;
use chrono::prelude::*;
use mysql::prelude::*;
use mysql::*;
use crate::fmt_print::print_std; // 用来处理日期
/*
CREATE TABLE `penalty_msg` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`height` bigint(20) unsigned NOT NULL,
`from_addr` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL DE... | rickiey/rs | src/mysqlcli/mycli.rs | Rust | unknown | 5,089 |
pub mod sstring;
| rickiey/rs | src/strt/mod.rs | Rust | unknown | 17 |
pub fn sts() {
create_str()
}
fn create_str() {
let mut s1 = "s1".to_string();
let s2 = String::from("s2");
let mut s3 = String::new();
s3.push('s');
s3.push_str("3");
s1 = s1 + &s2;
println!("{} {} {}", s1, s2, s3);
let mut my_name = "Pascal".to_string();
my_name.push_str(" P... | rickiey/rs | src/strt/sstring.rs | Rust | unknown | 972 |
pub mod strait;
| rickiey/rs | src/struct_trait/mod.rs | Rust | unknown | 16 |
use std::fmt;
// 导入 `fmt`
// use typename::TypeName;
// 带有两个数字的结构体。推导出 `Debug`,以便与 `Display` 的输出进行比较。
#[derive(Debug,Eq,Clone,Copy,Hash,Ord, PartialOrd, PartialEq)]
pub struct MinMax(pub i64, pub i64);
// 实现 `MinMax` 的 `Display`。
impl fmt::Display for MinMax {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result ... | rickiey/rs | src/struct_trait/strait.rs | Rust | unknown | 2,221 |
# You can put files here to add functionality separated per file, which
# will be ignored by git.
# Files on the custom/ directory will be automatically loaded by the init
# script, in alphabetical order.
# For example: add yourself some shortcuts to projects you often work on.
#
# brainstormr=~/Projects/development/p... | zsh/ohmyzsh | custom/example.zsh | Shell | mit | 363 |
# Add your own custom plugins in the custom/plugins directory. Plugins placed
# here will override ones with the same name in the main plugins directory.
| zsh/ohmyzsh | custom/plugins/example/example.plugin.zsh | Shell | mit | 154 |
# Put your custom themes in this folder.
# Example:
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "
| zsh/ohmyzsh | custom/themes/example.zsh-theme | Shell | mit | 147 |
## Bazaar integration
## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT
function bzr_prompt_info() {
BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'`
if [ -n "$BZR_CB" ]; then
BZR_DIRTY=""
[[ -n `bzr status` ]] && BZR_DIRTY=" %{$fg[red... | zsh/ohmyzsh | lib/bzr.zsh | Shell | mit | 430 |
#!/usr/bin/env zsh
function omz {
[[ $# -gt 0 ]] || {
_omz::help
return 1
}
local command="$1"
shift
# Subcommand functions start with _ so that they don't
# appear as completion entries when looking for `omz`
(( $+functions[_omz::$command] )) || {
_omz::help
return 1
}
_omz::$comm... | zsh/ohmyzsh | lib/cli.zsh | Shell | mit | 22,566 |
# System clipboard integration
#
# This file has support for doing system clipboard copy and paste operations
# from the command line in a generic cross-platform fashion.
#
# This is uses essentially the same heuristic as neovim, with the additional
# special support for Cygwin.
# See: https://github.com/neovim/neovim/... | zsh/ohmyzsh | lib/clipboard.zsh | Shell | mit | 4,236 |
# Handle completions insecurities (i.e., completion-dependent directories with
# insecure ownership or permissions) by:
#
# * Human-readably notifying the user of these insecurities.
function handle_completion_insecurities() {
# List of the absolute paths of all unique insecure directories, split on
# newline from ... | zsh/ohmyzsh | lib/compfix.zsh | Shell | mit | 1,822 |
# fixme - the load process here seems a bit bizarre
zmodload -i zsh/complist
WORDCHARS=''
unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol
setopt auto_menu # show completion menu on successive tab press
setopt complete_in_word
setopt always_to_end
# should this be ... | zsh/ohmyzsh | lib/completion.zsh | Shell | mit | 3,126 |
if [[ "$ENABLE_CORRECTION" == "true" ]]; then
alias cp='nocorrect cp'
alias ebuild='nocorrect ebuild'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'
alias hpodder='nocorrect hpodder'
alias man='nocorrect man'
alias mkdir='nocorrect mkdir'
alias mv='nocorrect mv'
alias mysql='nocorrect mys... | zsh/ohmyzsh | lib/correction.zsh | Shell | mit | 405 |
# diagnostics.zsh
#
# Diagnostic and debugging support for oh-my-zsh
# omz_diagnostic_dump()
#
# Author: Andrew Janke <andrew@apjanke.net>
#
# Usage:
#
# omz_diagnostic_dump [-v] [-V] [file]
#
# NOTE: This is a work in progress. Its interface and behavior are going to change,
# and probably in non-back-compatible ways... | zsh/ohmyzsh | lib/diagnostics.zsh | Shell | mit | 11,718 |
# Changing/making/removing directory
setopt auto_pushd
setopt pushd_ignore_dups
setopt pushdminus
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias -g ......='../../../../..'
alias -- -='cd -'
alias 1='cd -1'
alias 2='cd -2'
alias 3='cd -3'
alias 4='cd -4'
alias 5='cd -5'
alias 6='cd -6... | zsh/ohmyzsh | lib/directories.zsh | Shell | mit | 617 |
function zsh_stats() {
fc -l 1 \
| awk '{ CMD[$2]++; count++; } END { for (a in CMD) print CMD[a] " " CMD[a]*100/count "% " a }' \
| grep -v "./" | sort -nr | head -n 20 | column -c3 -s " " -t | nl
}
function uninstall_oh_my_zsh() {
env ZSH="$ZSH" sh "$ZSH/tools/uninstall.sh"
}
function upgrade_oh_my_zsh(... | zsh/ohmyzsh | lib/functions.zsh | Shell | mit | 6,777 |
# The git prompt's git commands are read-only and should not interfere with
# other processes. This environment variable is equivalent to running with `git
# --no-optional-locks`, but falls back gracefully for older versions of git.
# See git(1) for and git-status(1) for a description of that flag.
#
# We wrap in a loc... | zsh/ohmyzsh | lib/git.zsh | Shell | mit | 10,308 |
__GREP_CACHE_FILE="$ZSH_CACHE_DIR"/grep-alias
# See if there's a cache file modified in the last day
__GREP_ALIAS_CACHES=("$__GREP_CACHE_FILE"(Nm-1))
if [[ -n "$__GREP_ALIAS_CACHES" ]]; then
source "$__GREP_CACHE_FILE"
else
grep-flags-available() {
command grep "$@" "" &>/dev/null <<< ""
}
# I... | zsh/ohmyzsh | lib/grep.zsh | Shell | mit | 1,467 |
## History wrapper
function omz_history {
local clear list
zparseopts -E c=clear l=list
if [[ -n "$clear" ]]; then
# if -c provided, clobber the history file
echo -n >| "$HISTFILE"
fc -p "$HISTFILE"
echo >&2 History file deleted.
elif [[ -n "$list" ]]; then
# if -l provided, run as if calli... | zsh/ohmyzsh | lib/history.zsh | Shell | mit | 1,478 |
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
# Make sure that the terminal is in application mode when zle is active, since
# only then values from ... | zsh/ohmyzsh | lib/key-bindings.zsh | Shell | mit | 4,899 |
autoload -Uz is-at-least
# *-magic is known buggy in some versions; disable if so
if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then
for d in $fpath; do
if [[ -e "$d/url-quote-magic" ]]; then
if is-at-least 5.1; then
autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-mag... | zsh/ohmyzsh | lib/misc.zsh | Shell | mit | 746 |
# get the nvm-controlled node.js version
function nvm_prompt_info() {
which nvm &>/dev/null || return
local nvm_prompt=${$(nvm current)#v}
echo "${ZSH_THEME_NVM_PROMPT_PREFIX}${nvm_prompt:gs/%/%%}${ZSH_THEME_NVM_PROMPT_SUFFIX}"
}
| zsh/ohmyzsh | lib/nvm.zsh | Shell | mit | 236 |
# *_prompt_info functions for usage in your prompt
#
# Plugin creators, please add your *_prompt_info function to the list
# of dummy implementations to help theme creators not receiving errors
# without the need of implementing conditional clauses.
#
# See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
# git_prompt... | zsh/ohmyzsh | lib/prompt_info_functions.zsh | Shell | mit | 1,432 |
# A script to make using 256 colors in zsh less painful.
# P.C. Shyamshankar <sykora@lucentbeing.com>
# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
typeset -AHg FX FG BG
FX=(
reset "%{[00m%}"
bold "%{[01m%}" no-bold "%{[22m%}"
italic "%{[03m%}" no-italic ... | zsh/ohmyzsh | lib/spectrum.zsh | Shell | mit | 1,231 |
# Set terminal window and tab/icon title
#
# usage: title short_tab_title [long_window_title]
#
# See: http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
# Fully supports screen, iterm, and probably most modern xterm and rxvt
# (In screen, only short_tab_title is used)
# Limited support for Apple Terminal (Term... | zsh/ohmyzsh | lib/termsupport.zsh | Shell | mit | 4,815 |
JihuLab Code Dataset
A comprehensive code dataset compiled from JihuLab, GitLab's official Chinese distribution and the primary GitLab instance for Chinese developers and enterprises. This dataset is specifically designed to support training code models with strong Chinese language understanding and enterprise-level coding practices.
Overview
The JihuLab Code Dataset represents a significant code corpus from China's official GitLab platform, capturing both open-source and enterprise projects across 304 programming languages. It serves as a valuable resource for developing multilingual code understanding models tailored to Chinese developers and organizations, with compliance to Chinese regulatory requirements.
Key Statistics
| Metric | Value |
|---|---|
| Total Files | 1,853,253 |
| Total Repositories | 11,589 |
| Compressed Size | 1.5 GB (Parquet with Zstd) |
| Uncompressed Size | 12.76 GB |
| Programming Languages | 304 |
| File Format | Single Parquet file |
Dataset Characteristics
Scope and Coverage
This dataset captures code from over 11,500 repositories hosted on JihuLab, including:
- Chinese enterprise ecosystem: Extensive coverage of code from Chinese developers and enterprises, featuring Chinese comments, documentation, and variable naming conventions
- Diverse language ecosystem: Support for 304 distinct programming languages
- Developer and enterprise projects: A comprehensive mix of individual developer projects and enterprise-grade codebases
- GitLab-native practices: Code following GitLab workflows and best practices
- Quality-assured: Rigorously filtered to exclude vendor code, build artifacts, generated files, and low-quality content
Programming Languages
The dataset encompasses 304 languages. The 30 most represented languages by file count are:
| Rank | Language | File Count |
|---|---|---|
| 1 | Java | 348,517 |
| 2 | C | 209,924 |
| 3 | JavaScript | 191,164 |
| 4 | Python | 172,798 |
| 5 | C++ | 136,046 |
| 6 | Go | 80,000 |
| 7 | TypeScript | 79,067 |
| 8 | HTML | 69,173 |
| 9 | C# | 64,511 |
| 10 | Rust | 50,515 |
| 11 | Shell | 43,352 |
| 12 | Vue | 40,687 |
| 13 | TSX | 36,844 |
| 14 | CSS | 34,779 |
| 15 | Makefile | 26,227 |
| 16 | Ruby | 25,812 |
| 17 | PHP | 21,401 |
| 18 | CMake | 15,292 |
| 19 | Kotlin | 14,220 |
| 20 | BitBake | 13,060 |
| 21 | SCSS | 10,957 |
| 22 | Scala | 9,333 |
| 23 | Dart | 9,125 |
| 24 | Lua | 7,413 |
| 25 | ASP.NET | 7,005 |
| 26 | Vim Script | 5,710 |
| 27 | Unix Assembly | 5,239 |
| 28 | Starlark | 5,134 |
| 29 | Objective-C | 4,931 |
| 30 | Factor | 4,920 |
License Distribution
Files are distributed across various open-source licenses. Repositories with restrictive terms (CC-BY-ND, Commons Clause, SSPL) have been excluded to ensure broader usability.
| License | File Count |
|---|---|
| Apache 2.0 | 551,008 |
| Unknown | 535,320 |
| MIT | 320,834 |
| AGPL 3.0 | 169,922 |
| GPL 2.0 | 112,829 |
| BSD | 65,104 |
| CC0 1.0 | 13,557 |
| LGPL 3.0 | 12,871 |
| LGPL 2.1 | 9,960 |
| BSD-3-Clause | 9,109 |
| BSL 1.1 | 8,972 |
| EPL 1.0 | 7,494 |
| GPL 3.0 | 7,476 |
| Unlicense | 6,265 |
| CC-BY 3.0 | 4,717 |
| CC-BY-NC-SA | 4,339 |
| MPL 2.0 | 3,847 |
| CC-BY 4.0 | 2,459 |
| CC-BY-NC-SA 4.0 | 1,715 |
| CC-BY-SA 4.0 | 1,701 |
| BSD-2-Clause | 1,599 |
| CC-BY-NC-ND 4.0 | 1,222 |
| ISC | 520 |
| WTFPL | 274 |
| CC-BY-NC 4.0 | 122 |
| CC-BY-SA | 13 |
| CC-BY-SA 3.0 | 4 |
Dataset Structure
Data Fields
Each record contains six fields providing comprehensive metadata and content information:
| Field | Type | Description |
|---|---|---|
code |
string | The complete source code content in UTF-8 encoding |
repo_name |
string | Repository identifier in the format username/repo or group/subgroup/repo |
path |
string | File path relative to the repository root |
language |
string | Programming language identified using go-enry |
license |
string | Repository license (SPDX identifier or "unknown") |
size |
int64 | File size in bytes |
Sample Record
{
"code": "package com.example.demo;\n\nimport org.springframework.boot.*;\nimport org.springframework.boot.autoconfigure.*;\n...",
"repo_name": "SmallQ/demo",
"path": "src/main/java/com/example/demo/DemoApplication.java",
"language": "Java",
"license": "unknown",
"size": 400
}
File Format
- Format: Apache Parquet with Zstd compression
- Structure: Single consolidated file (
data.parquet) - Encoding: UTF-8
- Split: All examples are included in a single training split (no validation or test splits)
Data Creation Process
Pipeline Stages
The dataset was constructed through a systematic multi-stage pipeline:
- Repository Discovery – Enumeration of public repositories using JihuLab's GitLab API (
/api/v4/projects) with paginated requests - Branch Selection – Extraction of the repository's default branch, typically
mainormaster - Repository Cloning – Download of repository archives via JihuLab's archive endpoint
- Content Extraction and Filtering – Intelligent extraction and quality filtering of source code files
- Parquet Serialization – Writing processed records to compressed Parquet format
Language Detection
Programming languages are identified using go-enry, a Go implementation of GitHub's Linguist classification system. Only files classified as Programming or Markup types are retained; Data and Prose file types are excluded.
License Detection
License identification follows a three-step process:
- Scan for license files:
LICENSE,LICENSE.txt,LICENSE.md,COPYING, and similar variants - Match license text against known patterns (MIT, Apache 2.0, GPL variants, BSD, Creative Commons, etc.)
- Default to "unknown" if no license match is found
Excluded Licenses: The following restrictive licenses are filtered out to ensure broad usability:
- Creative Commons No-Derivatives:
cc-by-nd,cc-by-nd-2.0,cc-by-nd-3.0,cc-by-nd-4.0 commons-clause- Server Side Public License:
sspl,sspl-1.0
Quality Filtering
Extensive filtering mechanisms ensure dataset quality and usability:
Size Constraints
| Constraint | Limit |
|---|---|
| Maximum repository compressed size | 48 MB |
| Maximum single file size | 1 MB |
| Maximum line length | 1,000 characters |
Excluded Directories
Version Control and IDE Configuration
.git/,.github/,.gitlab/,.vscode/,.idea/,.vs/,.settings/,.eclipse/,.project/,.metadata/
Dependencies and Vendor Code
node_modules/,bower_components/,jspm_packages/,vendor/,third_party/,3rdparty/,external/,packages/,deps/,lib/vendor/,target/dependency/,Pods/
Build Artifacts and Output
build/,dist/,out/,bin/,target/,release/,debug/,.next/,.nuxt/,_site/,_build/,__pycache__/,.pytest_cache/,cmake-build-*,.gradle/,.maven/
Excluded Files
Dependency Lock Files
package-lock.json,yarn.lock,pnpm-lock.yaml,Gemfile.lock,Cargo.lock,poetry.lock,Pipfile.lock,composer.lock,go.sum,mix.lock
Minified Code
- Any file containing
.min.in the filename
Binary and Non-Code Files
- Executables:
.exe,.dll,.so,.dylib,.a,.lib,.o,.obj - Java archives:
.jar,.war,.ear,.class,.pyc,.pyo,.wasm - Documents:
.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx - Archives:
.zip,.tar,.gz,.bz2,.7z,.rar - Media:
.jpg,.jpeg,.png,.gif,.bmp,.ico,.svg,.mp3,.mp4,.avi,.mov,.wav,.flac - Fonts:
.ttf,.otf,.woff,.woff2,.eot
System Files
.DS_Store,thumbs.db
Content Validation
Files must meet the following criteria to be included:
- Text Encoding: Valid UTF-8 encoding required
- Binary Detection: Files identified as binary by go-enry are excluded
- Auto-generation Markers: Files with generation indicators in the first 500 bytes are filtered out:
- Markers:
generated by,do not edit,auto-generated,autogenerated,automatically generated,code generator,generated code,this file is generated,@generated,<auto-generated
- Markers:
- Content Quality: Empty files or those containing only whitespace are excluded
- Line Length: Files with any line exceeding 1,000 characters are excluded
- Advanced Filtering: Additional go-enry checks exclude vendor code, images, dotfiles, test files, and detected generated code
- Repository Type: Repositories containing only documentation are skipped
Usage Considerations
Data Privacy and Security
The dataset may contain sensitive information that requires careful handling:
- Email Addresses: Present in code comments, documentation, or configuration files
- Credentials: Accidentally committed API keys or authentication tokens
- Personal Information: Names, phone numbers, and other identifiable data in comments or documentation
Users should implement appropriate filtering and anonymization when preparing data for model training.
Licensing and Attribution
This dataset aggregates source code from repositories with diverse licenses. Any use of code or data derived from this dataset must comply with the original repository licenses, including attribution requirements where applicable.
The license field in each record indicates the license of the source repository. Users are responsible for:
- Reviewing applicable license terms
- Providing proper attribution when required
- Ensuring compliance with license restrictions
Technical Details
Source: Public repositories hosted on JihuLab
Annotations: Machine-generated (language detection, license identification)
Multilingual Support: Includes multilingual code and documentation with emphasis on Chinese content
Task Categories: Text generation, code modeling, language understanding
Tags: Code, Chinese language, multilingual, enterprise development
- Downloads last month
- 23