Skip to content

Instantly share code, notes, and snippets.

View NickHatBoecker's full-sized avatar

Nick NickHatBoecker

View GitHub Profile
@NickHatBoecker
NickHatBoecker / DragElement.gd
Created January 5, 2024 18:38
A drag 'n drop Godot 3 example
extends KinematicBody2D
signal has_reached_target_position
export var targetPosition = Vector2(-1, -1)
var isDragging: bool = false
var hasReachedTargetPosition: bool = false
@NickHatBoecker
NickHatBoecker / app.js
Last active November 24, 2022 11:29
DND Toggle:: Node Helper
const express = require('express')
const app = express()
const port = 5511
app.get('/get-dnd-state', (req, res) => {
const { exec } = require('child_process')
exec('osascript -l JavaScript ~/bin/get-focus-mode.scpt', (error, stdout, stderr) => {
if (error || stderr) {
res.send('No focus')
@NickHatBoecker
NickHatBoecker / NhbIntroPlugin.js
Last active August 7, 2021 21:19
NHB Intro Plugin for Phaser3 - Play any video and enable to skip with configurable key input.
import Phaser from 'phaser'
export default class NhbIntroPlugin extends Phaser.Plugins.ScenePlugin {
constructor (scene, pluginManager) {
super(scene, pluginManager)
this.defaultConfig = {
skipKeys: ['ENTER', 'SPACE'],
}
@NickHatBoecker
NickHatBoecker / Page.vue
Created May 30, 2021 15:40
Navigation Animation in VueJS
<template>
<div class="navigation-animation">
<nav class="nav" ref="menu">
<a
v-for="(link, index) in links"
:key="index"
:href="link.url"
:class="{ 'link-item': true, 'active': link.active }"
>{{ link.title }}</a>
<div ref="activeState" class="active-state" />
@NickHatBoecker
NickHatBoecker / index.php
Created May 14, 2021 10:24
A simple recursive file looper in order to search for specific contents or to overwrite data
<?php
/**
* Example:
* php index.php /var/www/my_directory_to_search
*/
class Inputter
{
/** @var string */
private $searchDirectory;
// src/App.vue
<template>
<div>
<newsticker :text="Lorem ipsum dolor sit amet." />
</div>
</template>
<script>
import Newsticker from '~/components/Newsticker'
// src/components/Newsticker.vue
<script>
export default {
props: {
text: { type: String, required: true },
},
data: () => ({
elementId: 'newsticker',
// src/components/Newsticker.vue
<style lang="scss" scoped>
.newsticker {
height: 100px;
overflow: hidden;
position: relative;
&__text {
white-space: nowrap;
// src/components/Newsticker.vue
<template>
<div :ref="elementWrapperId" class="newsticker" @click="toggleAnimation">
<div :ref="elementId" class="newsticker__text">{{ text }}</div>
</div>
</template>
@NickHatBoecker
NickHatBoecker / Newsticker.vue
Last active May 5, 2021 19:36
Newsticker in VueJS
<template>
<div :ref="elementWrapperId" class="newsticker" @click="toggleAnimation">
<div :ref="elementId" class="newsticker__text">{{ text }}</div>
</div>
</template>
<script>
export default {
props: {
text: { type: String, required: true },