Skip to content

Instantly share code, notes, and snippets.

View dzikoysk's full-sized avatar
🖤
ฅ^•ﻌ•^ฅ

dzikoysk

🖤
ฅ^•ﻌ•^ฅ
View GitHub Profile
@dzikoysk
dzikoysk / Lwjgl3CatchCursorAdapter.java
Last active September 8, 2020 11:51
Clip hardware cursor on Windows using libGDX with LWJGL3 backend, otherwise catch cursor with a standard API
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window;
import com.badlogic.gdx.utils.Array;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinDef.HWND;
@dzikoysk
dzikoysk / Lwjgl2CatchCursorAdapter.java
Last active September 8, 2020 11:43
Clip hardware cursor on Windows using libGDX with LWJGL2 backend, otherwise catch cursor with a standard API
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import org.lwjgl.LWJGLUtil;
import org.lwjgl.opengl.Display;
import org.panda_lang.utilities.commons.function.Lazy;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@jimode
jimode / context-and-localstorage-using-hooks.js
Last active October 8, 2024 05:58
Providing Context and Local Storage Using Hooks
// Providing Context
// ==================
import React, {useState, useEffect} from "react"
const Context = React.createContext()
function ContextProvider({children}) {
const [allPhotos, setAllPhotos] = useState([])
const [cartItems, setCartItems] = useState([])
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 18, 2024 16:45
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

@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active November 18, 2024 08:23
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@zapidan
zapidan / git-change-author
Last active September 18, 2024 06:47
Change previous commits author/email with filter-branch
## Make sure your local repo settings are correct
git config --local --list
git config --local user.name "author name"
git config --local user.email "[email protected]"
## Change previous n commits
git rebase -i HEAD~n
# choose the commits to change by adding 'pick' or 'reword' (only for changing the message)
git commit --amend --author="Author Name <[email protected]>"
# change first commit in repo
@CMCDragonkai
CMCDragonkai / higher_kinded_types_in_rust_and_haskell.md
Last active September 8, 2024 17:06
Rust/Haskell: Higher-Kinded Types (HKT)

Rust/Haskell: Higher-Kinded Types (HKT)

A higher kinded type is a concept that reifies a type constructor as an actual type.

A type constructor can be thought of in these analogies:

  • like a function in the type universe
  • as a type with a "hole" in it
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule