Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Voleking Voleking

🎯
Focusing
  • Beijing
Block or report user

Report or block Voleking

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Voleking
Voleking / SpaceFn.json
Last active Jul 9, 2019
Karabiner Elements config to simulation SpaceLauncher
View SpaceFn.json
{
"title": "SpaceFN",
"rules": [
{
"description": "SpaceFN: Space enables SpaceFN mode (see: https://geekhack.org/index.php?topic=51069.0)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar"
@Voleking
Voleking / .sVim
Last active Jan 20, 2019
sVim config
View .sVim
" Settings
set nosmoothscroll
let mapleader = ","
let newtaburl = "http://google.com"
let scrollduration = 5
@Voleking
Voleking / stdc++.h
Created Jan 22, 2018
Linux GCC 4.8.0 /bits/stdc++.h header definition.
View stdc++.h
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@Voleking
Voleking / save_safari_tabs.scpt
Last active Jul 12, 2019
Save all safari tabs in a single file and reopen them with a single click.
View save_safari_tabs.scpt
-- Detect if the Safari window exists
tell application "System Events"
if not (exists (front window of process "Safari")) then
return
end if
end tell
-- Assume the frontmost Finder window (or the Desktop)
-- is where we want to store the script.
try
@Voleking
Voleking / stlib.cpp
Created Dec 15, 2016
ACM/ICPC header
View stlib.cpp
#include <bits/stdc++.h>
#define IOS std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr);
// #define __DEBUG__
#ifdef __DEBUG__
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif
#define filename ""
@Voleking
Voleking / Meisell-Lehmer.cpp
Created Oct 12, 2016
calculate the prime number lower and equal than n quickly.
View Meisell-Lehmer.cpp
#include<bits/stdc++>
/Meisell-Lehmer
const int MAX_N = 5e6 + 2;
bool np[MAX_N];
int prime[MAX_N], pi[MAX_N];
int getprime()
{
int cnt = 0;
np[0] = np[1] = true;
pi[0] = pi[1] = 0;
You can’t perform that action at this time.