Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

logic.script "API_LoadNavigationData('Resources/missions/LV_Karhad_PvE_Caravanserai_Navigation.json')"
logic.script "for i = 0, 30 do API_SpawnBot({x=1,y=1,z=1},0,'TaurusRPG',-1) end"
// generated by quake, do not modify
unbindall
bind TAB "+scores"
bind ENTER "+button2"
bind ESCAPE "togglemenu"
bind SPACE "+moveup"
bind + "sizeup"
bind - "sizedown"
bind / "weapnext"
bind 0 "weapon 10"
@vivkin
vivkin / colors.h
Created September 4, 2017 09:57
Color schemes and palette for use in C
#pragma once
// https://yeun.github.io/open-color/
enum oc_names {
oc_gray,
oc_red,
oc_pink,
oc_grape,
oc_violet,
@vivkin
vivkin / 16-color-table.sh
Created May 26, 2017 07:11
Terminal color test scripts
#!/bin/bash
#
# This file echoes a bunch of color codes to the terminal to demonstrate
# what's available. Each line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a test use of that color
# on all nine background colors (default + 8 escapes).
#
T='gYw' # The test text
echo -e "\n 40m 41m 42m 43m 44m 45m 46m 47m";
for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' ' 36m' '1;36m' ' 37m' '1;37m';
@vivkin
vivkin / showaddrinfo.c
Created May 23, 2017 23:38
show getaddrinfo(3) results
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
int main(int argc, char **argv) {
@vivkin
vivkin / myfire.py
Created March 11, 2017 18:05
google/python-fire in 30 seconds
from __future__ import print_function
import sys
class Calculator(object):
"""A simple calculator class."""
def double(self, number):
return 2 * number
if __name__ == '__main__':
int d = 42;
int o = 052;
int foo = 2321312;
int x = 0xdead'beef;
int X = 0Xc0'0f'fe;
int y = 0XBAD'cab1e;
int Y = 0Xc0'0f'fe;
int b = 0b101010; // C++14
unsigned long long l1 = 18446744073709550592ull; // C++11
unsigned long long l2 = 18'446'744'073'709'550'592llu; // C++14
@vivkin
vivkin / unsplashy
Created July 7, 2016 08:51
unsplashy. download daily featured pictures from unsplash.com
#!/bin/sh
CATEGORIES="buildings food nature people technology objects"
DESTDIR=~/Pictures/unsplash
RESOLUTION=$(system_profiler SPDisplaysDataType | grep Resolution | sed 's/[^x0-9]//g')
for CATEGORY in ${CATEGORIES}; do
URL=https://source.unsplash.com/category/${CATEGORY}/${RESOLUTION}/daily
IMAGE=$(curl --silent --fail --location --write-out "%{url_effective}" --output /dev/null --url ${URL})
NAME=${IMAGE##*/}
set(CMAKE_SYSTEM_NAME Darwin)
execute_process(COMMAND xcrun --sdk iphoneos --show-sdk-path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND xcrun --sdk iphoneos --find cc OUTPUT_VARIABLE CMAKE_C_COMPILER OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND xcrun --sdk iphoneos --find c++ OUTPUT_VARIABLE CMAKE_CXX_COMPILER OUTPUT_STRIP_TRAILING_WHITESPACE)
include(CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} AppleClang)
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} AppleClang)
set(CMAKE_OSX_SYSROOT iphoneos CACHE STRING "")
set(CMAKE_OSX_ARCHITECTURES $(ARCHS_STANDARD) CACHE STRING "")
@vivkin
vivkin / includec.py
Last active August 29, 2015 14:13
Preprocess #include <...> directive
#!/usr/bin/python
import re
import sys
import os.path
import argparse
parser = argparse.ArgumentParser(description='Preprocess #include <...> directive')
parser.add_argument('-I', dest='paths', action='append',
help='add directory to include search path')
parser.add_argument('-o', '--output', dest='out', type=argparse.FileType('w'), default=sys.stdout,