Skip to content

Instantly share code, notes, and snippets.

View nochkin's full-sized avatar
💭
Breeding unicorns

Sashka nochkin

💭
Breeding unicorns
View GitHub Profile
@a1exus
a1exus / custom-jetpack-sitemap-20250317.php
Created March 22, 2025 12:59
ACF + Jetpack (sitemap)
<?php
/*
Plugin Name: Dynamic Post Types in Jetpack Sitemap (MU)
Description: Dynamically includes all registered public post types (including ACF types) in the Jetpack XML sitemap.
Version: 1.4
Author: ChatGPT
REF: https://www.advancedcustomfields.com/resources/post-types-and-taxonomies/#registering-custom-post-types
REF: https://developer.jetpack.com/hooks/jetpack_sitemap_post_types/
*/
@withoutwax
withoutwax / ror-api.markdown
Last active August 20, 2025 12:48
Guide on how to create an API-Only Application with Ruby on Rails 5

Creating an API-Only Application with Ruby on Rails

01 - Create a new API-only Rails app

rails new ror-app-name --api

02 - Basic Scaffold

01 - Model

This step is for creating a very basic level of model for us to work in. If you know already, or wish to apply your own custom models with relationships you can skip this step.

"""
The Pool module provides some classes for managing a fixed-size thread-safe pool of functionally identical objects. One use for this is database connections, which tend to take awhile to create.
Pool
class that manages the pool of objects.
Constructor
class used to create new instances of items in the Pool.
For more details, use pydoc or read the docstrings in the code.
@yocontra
yocontra / CommandEncoder.java
Created September 23, 2013 22:50
Command Encoder for Brookstone Rover 2.0 TCP Protocol
package com.wificar.component;
import android.util.Log;
import com.wificar.WificarActivity;
import com.wificar.util.BlowFish;
import com.wificar.util.ByteUtility;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import org.apache.http.util.ByteArrayBuffer;