Skip to content

Instantly share code, notes, and snippets.

View handicraftsman's full-sized avatar
🖥️

Nickolay handicraftsman

🖥️
View GitHub Profile
@handicraftsman
handicraftsman / CMakeRS.cmake
Last active August 6, 2020 18:40
CMakeRS.cmake
set(CMAKERS OFF)
if (NOT CMAKERS)
set(CMAKERS ON CACHE INTERNAL "" FORCE)
find_program(CMAKERS_CARGO cargo REQUIRED)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKERS_RELEASE "--release")
set(CMAKERS_TDIR "release")
else ()
@handicraftsman
handicraftsman / LibFinder.cmake
Created December 12, 2019 12:28
LibFinder.cmake
macro(_LIBFINDER_LIB variable lib)
find_library(${lib}-LIB ${lib})
if(${lib}-LIB-NOTFOUND)
message(FATAL "Unable to find library ${lib}")
endif()
message(STATUS "${lib} library at ${${lib}-LIB}")
list(APPEND ${variable} ${${lib}-LIB})
endmacro()
macro(LIBFINDER_LIBRARIES variable)
@handicraftsman
handicraftsman / test.cs
Created June 25, 2019 19:17
Some more GUI stuff, in C#
using System;
using AirKit;
using AirKit.Layout;
using AirKit.Material;
namespace AirKit.Demo
{
class MainView : View
{
@handicraftsman
handicraftsman / target.rkt
Last active June 21, 2019 17:40
Just some GUI stuff
#lang aurakit
(require aurakit/layout)
(require aurakit/material)
(define main-view-state%
(class ak-state%
(super-new)
(init-field [counter 0])
(defvar greeter:Greeter)
(defvar greeting:String)
(defvar anotherGreeting:String)
(set greeter (new Greeter "Great"))
(new Greeter "Great")
"Great"
(set greeting (.greet greeter "World"))
(.greet greeter "World")
greeter
"World"
@handicraftsman
handicraftsman / for.cpp
Created November 3, 2018 10:24
For loop
// same code as in quill part, but in C++
{
int i = 0
contfunc = [&] () { i++; }
while (i < 10) {
std::cout << i << std::endl;
contfunc();
}
std::cout << "Done counting" << std::endl;
}
@handicraftsman
handicraftsman / particlecc.lua
Last active August 2, 2018 10:08
ParticleCC
--[[
The MIT License (MIT)
Copyright (c) 2018 Nickolay Ilyushin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
#pragma once
#include <functional>
#include <memory>
#include <mutex>
template<class T>
class room {
public:
typedef std::shared_ptr<T> ptr;
module.exports = (obj, ...args) => {
return new Promise((res, rej) => {
try {
res(new obj(...args));
} catch (e) {
rej(e);
}
});
}
@handicraftsman
handicraftsman / pass.rb
Last active January 15, 2017 20:19
Generates strong random passwords
require "date"
dt = DateTime.now
base = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
blen = base.length
passlen = ARGV[0]
if passlen == "-"
passlen = gets