Skip to content

Instantly share code, notes, and snippets.

#include "FastLED.h"
#include <CapacitiveSensor.h>
#include <Servo.h>
// WS2812B definitions
#define NUM_LEDS 17
#define DATA_PIN 7
CRGB leds[NUM_LEDS];
int bright = 3;
#include <avr/interrupt.h>
#include <avr/power.h>
#include <avr/io.h>
#include <WaveHC.h>
#include <WaveUtil.h>
WaveHC wave; // This is the only wave (audio) object, -- we only play one at a time
#define error(msg) error_P(PSTR(msg)) // Macro allows error messages in flash memory
// 'Cyber falls' sketch, adapted from code for Firewalker sneakers.
// Creates a fiery rain-like effect on multiple NeoPixel strips.
// Requires Adafruit Trinket and NeoPixel strips. Strip length is
// inherently limited by Trinket RAM and processing power; this is
// written for five 15-pixel strands, which are paired up per pin
// for ten 15-pixel strips total.
#include <Adafruit_NeoPixel.h>
#include <avr/interrupt.h>
@grisevg
grisevg / AnimatedImage.cpp
Last active August 30, 2023 02:49
UMG Animated Image.
#include "AnimatedImage.h"
void UAnimatedImage::SetCurrentFrame(int32 Frame)
{
CurrentFrame = Frame;
if (CurrentFrame < 0) CurrentFrame = 0;
if (CurrentFrame > TotalFrames - 1) CurrentFrame = TotalFrames - 1;
SynchronizeProperties();
}
@grisevg
grisevg / FAsyncQueue.h
Last active October 20, 2023 03:39
Utility class for asynchronous/coroutine style programming in UE4 C++
#pragma once
/**
* FAsyncQueue can be used to run asynchronous delegates in sequence, parallel and combinations of the above
*
* Use Add() to enqueue delegates matching FAsyncDelegate signature:
* a void function that accepts a single argument of another void function with no arguments.
*
* Static factories MakeSync, MakeSequence and MakeParallel can be used to wrap different type of delegates and
* delegate collections into a single FAsyncDelegate which can be enqueued with Add().
INSERT INTO `amx_bans` (`player_ip`, `player_id`, `player_nick`, `admin_ip`, `admin_id`, `admin_nick`, `ban_type`, `ban_reason`, `ban_created`, `ban_length`, `server_ip`, `server_name`) VALUES
('', '', '', NULL, 'admin', 'admin', 'SI', 'autocheat', UNIX_TIMESTAMP(), 0, null, 'website');
@grisevg
grisevg / .tmux.conf
Created September 19, 2015 23:26
Babun setup
# More examples https://github.com/tangledhelix/dotfiles/blob/master/tmux.conf
###########################################################################
# Custom
# Allow to use vim navigation keys (hjkl) in tmux scroll mode
setw -g mode-keys vi
# Hack to let term window controll scrolling. Will override `set -g mode-mouse on`
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
@grisevg
grisevg / readline.md
Created June 2, 2015 20:32
Shortcuts

URL: http://www.bigsmoke.us/readline/shortcuts

  • Ctrl-A: go to the beginning of line,
  • Ctrl-E: go to the end of line,
  • Alt-B: skip one work backward,
  • Alt-F: skip one word forward,
  • Ctrl-U: delete to the beginning of line,
  • Ctrl-K: delete to the end of line,
  • Alt-D: delete to the end of word.
  • Ctrl-r: Incrementally search the line history ⇧ backwardly
@grisevg
grisevg / .tigrc
Last active August 29, 2015 14:22
My babun
set mouse = yes
class Collection {
var arr:Array<Int>;
var i:Int = 0;
public function new(arr:Array<Int>) {
this.arr = arr;
}
public var current(get, set):Int;
function get_current():Int { return arr[i]; }