Skip to content

Instantly share code, notes, and snippets.

@tomaytotomato
tomaytotomato / ArmA 3 Move Static Object
Created July 2, 2017 16:17
Script allows you to move a static object from one position to another using a time delay and speed
/**
Arguments
1 - object to move (non player object etc)
2 - starting position (use an invisible helipad)
3 - ending position (use an invisible helipad)
4 - move distance (metres)
5 - timing, i.e. speed
example : null = [this,posA,posB,1,0.001] execVM "move_object.sqf";
@robweychert
robweychert / python-easing-function.md
Last active May 3, 2024 12:49
Python easing functions
@unseensenpai
unseensenpai / Program.cs
Last active May 3, 2024 12:48
Request Response Logging Middleware in .Net 8
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
WebApplication app = builder.Build();
app.UseRequestResponseLogging();
app.Run();
import React, { useRef, useEffect, useState } from 'react';
import {
ActivityIndicator,
StyleSheet,
Text,
TouchableOpacity,
TouchableWithoutFeedback,
View,
} from 'react-native';
import {
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 3, 2024 12:46
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@swnck
swnck / 3DPageViewer.js
Created March 29, 2024 03:13
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
//Credits: https://gist.github.com/OrionReed/4c3778ebc2b5026d2354359ca49077ca
(() => {
const THICKNESS = 5;
const MAX_ROTATION = 180;
const DISTANCE = 10000;
const getDOMDepth = element => [...element.children].reduce((max, child) => Math.max(max, getDOMDepth(child)), 0) + 1;
const body = document.body;
@OrionReed
OrionReed / dom3d.js
Last active May 3, 2024 12:42
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@rxaviers
rxaviers / gist:7360908
Last active May 3, 2024 12:42
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@arkatsy
arkatsy / zustand-internals.jsx
Last active May 3, 2024 12:41
How zustand works internally
import { useSyncExternalStore } from "react";
// For more on the useSyncExternalStore hook, see https://react.dev/reference/react/useSyncExternalStore
// The code is almost identical to the source code of zustand, without types and some features stripped out.
// Check the links to see the references in the source code.
// The links are referencing the v5 of the library. If you plan on reading the source code yourself v5 is the best way to start.
// The current v4 version contains lot of deprecated code and extra stuff that makes it hard to reason about if you're new to this.
// https://github.com/pmndrs/zustand/blob/fe47d3e6c6671dbfb9856fda52cb5a3a855d97a6/src/vanilla.ts#L57-L94
function createStore(createState) {
@takien
takien / youtubeID.js
Last active May 3, 2024 12:41
Get YouTube ID from various YouTube URL using JavaScript
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);