Skip to content

Instantly share code, notes, and snippets.

View sonictk's full-sized avatar
🤞
build.bat and hope everything works

Siew Yi Liang sonictk

🤞
build.bat and hope everything works
View GitHub Profile
Process: MTLCompilerService [10386]
Path: /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService
Identifier: MTLCompilerService
Version: 162.2 (162.2)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: main [10384]
User ID: 501
Date/Time: 2019-11-04 01:28:44.851 -0800
@sonictk
sonictk / CMakeLists.txt
Created August 30, 2018 22:40
cmake target compile options
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using GCC
set(CMAKE_VERBOSE_MAKEFILE 1)
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_DEFINITIONS "Bits64_;UNIX;_BOOL;LINUX;FUNCPROTO;_GNU_SOURCE;LINUX_64;REQUIRE_IOSTREAM")
set(GCC_COMPILE_OPTIONS "-m64;-fPIC;-fno-strict-aliasing;-Wall;-Wno-multichar;-Wno-comment;-Wno-sign-compare;-funsigned-char;-pthread;-Wno-deprecated;-Wno-reorder;-ftemplate-depth-64;-fno-gnu-keywords;-std=c++0x;-Winline")
set(GCC_COMPILE_DEBUG_OPTIONS "${GCC_COMPILE_OPTIONS};-ggdb;-O0")
#include <arpa/inet.h>
#include <fcntl.h>
#include <netdb.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <cstdlib>
FileType translateToContentType(const char *contentTypeStr)
{
def playblastViewport(outputDir,
filename='image',
fileFormat='iff'):
"""
This function playblasts the current active viewport to a given directory on
disk.
NOTE:
This function can only be run in a Maya interactive session.
default rel
bits 64
segment .text
global main
extern _CRT_INIT
extern ExitProcess
; Define constants to refer to the function arguments as offsets from RSP/RBP
@sonictk
sonictk / thunderbird_to_mutt.py
Created April 13, 2018 21:26 — forked from cboddy/thunderbird_to_mutt.py
A script to parse a csv address-book export from thunderbird and create mutt-aliases for each contact.
"""parse a csv address-book export from thunderbird and create mutt-aliases for each contact"""
import csv
import collections
import argparse
Contact = collections.namedtuple("Contact", ["first", "last", "email"])
def line_to_contact(line):
"""return: Contact based on csv line"""
@sonictk
sonictk / .clang_complete
Created February 5, 2018 09:06
.clang_complete sample
-std=c++14
-Wall
-Wextra
-pthread
-Wno-pragma-once-outside-header
-Ithirdparty
-IC:\\Program Files\\glew\\include
-IC:\\Program Files\\GLFW\\include
-IC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.14393.0\\shared
-IC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.14393.0\\ucrt
@sonictk
sonictk / .dir-locals.el
Created February 5, 2018 09:04
sample dir locals
(
(nil . ((tab-width . 4)
(indent-tabs-mode . nil)))
(c++-mode . ((c-basic-offset . 4)
(tab-width . 4)
(indent-tabs-mode . t)
(compile-command . "cmake --build . --config Debug --target INSTALL")
(cd-compile-directory . "C:\\Users\\sonictk/Git\\experiments\\opengl_test\\build")
(cc-search-directories . ("."
// File: pjson.h - written by Rich Geldreich 2012 - License: Unlicense http://unlicense.org/
#ifndef PURPLE_JSON_H
#define PURPLE_JSON_H
#ifdef WIN32
#pragma once
#endif
#include <string>
#include <vector>
@sonictk
sonictk / drawTextMayaVP1.py
Created May 25, 2017 06:58
Draw text in the Maya VP1 viewport
import maya.OpenMaya as om
import maya.OpenMayaUI as OpenMayaUI
def drawText(*args):
view = OpenMayaUI.M3dView.active3dView()
view.beginGL()
view.drawText('test text 2', om.MPoint(5, 5, 0.0, 1.0))
view.endGL()