Skip to content

Instantly share code, notes, and snippets.

View rokups's full-sized avatar
👾

Rokas Kupstys rokups

👾
View GitHub Profile
@rokups
rokups / ctor.nim
Created January 13, 2018 12:15
A macro which creates constructors for nim
{.experimental.}
import macros
import tables
macro ctor*(none: untyped): auto =
let args = callsite()
if args[1].kind != nnkProcDef:
error("`ctor` pragma is used only with procedures.")
var procTemplate = args[1]
var paramsTemplate = procTemplate[3]
diff --git a/Source/Urho3D/Graphics/AnimationState.cpp b/Source/Urho3D/Graphics/AnimationState.cpp
index a6a22d16b..3d54836e9 100644
--- a/Source/Urho3D/Graphics/AnimationState.cpp
+++ b/Source/Urho3D/Graphics/AnimationState.cpp
@@ -138,7 +138,10 @@ void AnimationState::SetStartBone(Bone* startBone)
const StringHash& nameHash = i->second_.nameHash_;
if (nameHash == startBone->nameHash_)
+ {
trackBone = startBone;
function test()
{
if (1 != 1)
{
print('workie 1')
}
else if (2 == 3)
{
print('....')
}
Usage: [OPTIONS]
Options:
-h,--help Print this help message and exit
--headless Do not initialize graphics subsystem
--nolimit Disable frame limiter
--flushgpu Enable GPU flushing
--gl2 Force use of OpenGL2
--landscape Force landscape orientation
@rokups
rokups / mem-loader.asm
Created October 8, 2018 06:58 — forked from zznop/mem-loader.asm
Fun little loader shellcode that executes an ELF in-memory using an anonymous file descriptor (inspired by https://x-c3ll.github.io/posts/fileless-memfd_create/)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Copyright (C), zznop, zznop0x90@gmail.com
;;;
;;; This software may be modified and distributed under the terms
;;; of the MIT license. See the LICENSE file for details.
;;;
;;; DESCRIPTION
;;;
;;; This PoC shellcode is meant to be compiled as a blob and prepended to a ELF
##
## Copyright (c) 2018 Rokas Kupstys
##
## 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
## furnished to do so, subject to the following conditions:
##
/// Template implementation of the object factory.
template <class T> class ObjectFactoryImpl : public ObjectFactory
{
public:
/// Construct.
explicit ObjectFactoryImpl(Context* context) :
ObjectFactory(context)
{
typeInfo_ = T::GetTypeInfoStatic();
allocator_ = AllocatorInitialize(sizeof(T));
#!/usr/bin/bash
if [ "$EUID" != "0" ];
then
echo "Please run as root."
exit
fi
driver="$1"
shift
#!/usr/bin/env sh
param() {
if [[ "$1" == "" ]];
then
echo $2
else
echo $1
fi
}
@rokups
rokups / FSM.h
Last active November 25, 2018 09:49
Tiny finite state machine implementation powered by preprocessor abuse.
//
// Copyright (c) 2018 Rokas Kupstys
//
// 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
// furnished to do so, subject to the following conditions:
//