Skip to content

Instantly share code, notes, and snippets.

View dec04's full-sized avatar
🚧
Construct something

Decoy dec04

🚧
Construct something
View GitHub Profile

Add command to toggle quake mode

        {
            "command": 
            {
                "action": "globalSummon",
                "name": "_quake",
                "toggleVisibility": true
            },
            "keys": "f1"

Detecting when the script has been executed

Now, there is a big issue you must know about. Doing that implies that you remotely load the code. Modern web browsers will load the file and keep executing your current script because they load everything asynchronously to improve performance. (This applies to both the jQuery method and the manual dynamic script loading method.)

It means that if you use these tricks directly, you won't be able to use your newly loaded code the next line after you asked it to be loaded, because it will be still loading.

For example: my_lovely_script.js contains MySuperObject:

var js = document.createElement("script");

js.type = "text/javascript";
@dec04
dec04 / modding_discord.md
Created May 27, 2022 08:52 — forked from vanyle/modding_discord.md
Modding the Discord client

Modding the discord client

Disclaimer: Modding the discord client is against Discord's term of service. I'm not responsible if any action is taken against you.

Why modding ?

Modding the client will allow you to customize to:

  • change the appearance of the discord client
  • have script to automaticaly send messages at specific times
  • log messages from a chat into a local file

This guide will explain how to inject js code into the discord client and send messages. I'm assuming you know you to write javascript code and are using Windows.

Конфигурации лежат в папке 19.10.2021

Требуется обновить:

  • Общий модуль аоИнтернетЗаказыСервер;
  • WebService ex;
@dec04
dec04 / CustomTextView.java
Created November 26, 2020 07:38 — forked from evelyne24/CustomTextView.java
This is how to get the colour from a custom style within a custom style within an Android Theme.
package org.codeandmagic.android.customtheme;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.widget.TextView;
@dec04
dec04 / HerokuSteps.md
Last active October 20, 2020 03:40 — forked from evenchange4/step.md
Deploy a Express.js project on Heroku

Deploy a Express.js project on Heroku

Step by step from command line by Michael Hsu

Quick start

Create a Node.js web framework 'express'

$ express myfirstexpress && cd myfirstexpress

Declare dependencies with NPM /package.json

public class SingletonClass implements Serializable {
private static volatile SingletonClass sSoleInstance;
//private constructor.
private SingletonClass(){
//Prevent form the reflection api.
if (sSoleInstance != null){
throw new RuntimeException("Use getInstance() method to get the single instance of this class.");