Skip to content

Instantly share code, notes, and snippets.

to workaround this log WARN when runing JDG clustered mode in a Mac box:

13:49:41,276 WARN  [org.jgroups.protocols.UDP] (TransferQueueBundler,shared=udp) JGRP000034: null: failure sending message to /234.99.54.14: java.io.IOException: Can't assign requested address (received 11 identical messages from /234.99.54.14 in the last 63239 ms)
# Adds a multicast route for 224.0.0.1-231.255.255.254
sudo route add -net 224.0.0.0/5 127.0.0.1
# Adds a multicast route for 232.0.0.1-239.255.255.254
@AadilGillani
AadilGillani / smali-cheatsheet.txt
Created October 1, 2021 06:49
Smalli Cheat-Sheet
A little help in Smali
(To be supplemented)
#
general information
#
Smali
Types
Dalvik bytecode has two main type classes, primitive types and reference types. Reference types are objects and arrays, everything else is primitive.
@valiant-code
valiant-code / IronMon-Rules.md
Last active May 1, 2024 01:46
IronMon Rules

The IronMON Challenge

The IronMon challenge is a Pokémon Randomizer Challenge run created by Iateyourpie. Designed to make experiencing the randomizer fun and challenging, while taking away the wild Pokémon grind that come with some other challenges. It was originally made for Fire Red / Leaf Green but the rules can be applied/adjusted for other games as well. If you're interested to find out more about IronMon, join our Discord community!

IronMon has varying levels of difficulties, to keep it more approachable but also provide the toughest challenge possible for those who want it.

#include <metal_stdlib>
using namespace metal;
namespace SmoothMin2d {
float smoothMin(float x1, float x2, float k) {
float h = clamp(0.5 - 0.5 * (x2 - x1) / k, 0.0, 1.0);
return mix(x1, x2, h) - k * h * (1.0 - h);
}
float circleSDF(float2 point, float2 center, float radius) {
@caspg
caspg / 1_searchbar_live.ex
Last active May 1, 2024 01:44
Example of real-time search bar implementation in Phoenix LiveView and Tailwind. Working example on https://travelermap.net/parks/usa
defmodule TravelerWeb.SearchbarLive do
use TravelerWeb, :live_view
alias Phoenix.LiveView.JS
alias Traveler.Places
def mount(_params, _session, socket) do
socket = assign(socket, places: [])
{:ok, socket, layout: false}
end
@masudcsesust04
masudcsesust04 / change-apache-default-document-root-directory.md
Created July 28, 2017 05:57
4 steps to change your apache default document root directory

Step - 1: Create a directory

$ mkdir /home/masud/www/

Step - 2: Open apache2 configuration file

$ sudo nano /etc/apache2/apache2.conf 
const { getJson, getBuffer, command, isPrivate, sleep } = require("../lib/");
command({
pattern: "owner",
fromMe: isPrivate,
desc: "Izumi Owner",
type: "support",
}, async (message) => {
const name = 'Eʏᴘᴢ ☔', title = "Iᴢᴜᴍɪ Sᴜᴘᴘᴏʀᴛ🧚‍♂️", number = '917994489493', body = "Eʏᴘᴢ☔";
const image = "https://i.imgur.com/JS0TpvM.jpeg", sourceUrl = 'https://github.com/sataniceypz/Izumi-v2';
@m5lil
m5lil / reset.sh
Last active May 1, 2024 01:39
[reset jetbrains application trial] reset jetbrains ide evals v1.0.4 #others
#!/bin/bash
# reset jetbrains ide evals v1.0.4
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"
if [ "$OS_NAME" == "Darwin" ]; then
echo 'macOS:'
for PRD in $JB_PRODUCTS; do
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 1, 2024 01:38
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent