Skip to content

Instantly share code, notes, and snippets.

@mage1k99
mage1k99 / how_to_install.md
Last active May 2, 2024 05:33
How to install WordPress with caddy2

How to Install WordPress in Caddy 2

PHP Version : 8.0 Wordpress version : 5.7.2 Caddy version : v2.4.3


Note!

This one is outdated: please check the offical guide here

@bmaupin
bmaupin / gammu-wammu.md
Last active May 2, 2024 05:33
Export feature phone SMS using Gammu/Wammu

General notes

SMS

Gammu/Wammu may not be able to retrieve dates for sent messages, only received messages.

MMS

MMS messages may not be able to be exported using Gammu/Wammu with some phones. If you don't see MMS in the exported messages, you may be able to save the message attachments to the phone's storage and copy them to a PC via a USB cable.

@remarkablemark
remarkablemark / phaser-toss-the-turtle-demo.js
Created April 26, 2024 19:00
Phaser: Toss the Turtle prototype
class Example extends Phaser.Scene
{
preload() {
this.load.image('backdrop', 'assets/pics/platformer-backdrop.png');
this.load.image('cannon_head', 'assets/tests/timer/cannon_head.png');
this.load.image('cannon_body', 'assets/tests/timer/cannon_body.png');
this.load.spritesheet('chick', 'assets/sprites/chick.png', { frameWidth: 16, frameHeight: 18 });
}
create() {

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh
@bmaupin
bmaupin / free-backend-hosting.md
Last active May 2, 2024 05:31
Free backend hosting
@stevenyap
stevenyap / Capybara.md
Created October 23, 2013 05:03
Capybara Cheatsheet

Refer to: https://github.com/jnicklas/capybara

Note: Capybara does not show exceptions created by app. It will instead only tell you that the element you are searching for is not found.

Setup

  • Gemfile setup
gem "capybara"
gem 'selenium-webdriver' # requires for live browser demostration
@kdzwinel
kdzwinel / main.js
Last active May 2, 2024 05:30
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.
@bmaupin
bmaupin / free-database-hosting.md
Last active May 2, 2024 05:29
Free database hosting
@rain1024
rain1024 / azure_openai_nodejs_starter_code.js
Last active May 2, 2024 05:28
Azure OpenAI Starter Code
const axios = require('axios');
const YOUR_RESOURCE_NAME = ''; // Replace with your Azure OpenAI Resource name
const YOUR_DEPLOYMENT_NAME = ''; // Replace with your deployment id
const YOUR_API_KEY = ''; // Replace with your API key
const endpoint = `https://${YOUR_RESOURCE_NAME}.openai.azure.com/openai/deployments/${YOUR_DEPLOYMENT_NAME}/chat/completions?api-version=2023-05-15`;
async function getChatCompletions() {
try {