Skip to content

Instantly share code, notes, and snippets.


Mayne mayneyao

View GitHub Profile
ahmed-musallam / Circular.js
Created January 25, 2018 22:11
A simple circular javascript data structure (backed by an array)
View Circular.js
* A simple circular data structure
function Circular(arr, startIntex){
this.arr = arr;
this.currentIndex = startIntex || 0;
} = function(){
var i = this.currentIndex, arr = this.arr;
LawJolla / gatsby-node.js
Created September 18, 2017 05:15
Gatsby Create pages from API
View gatsby-node.js
// Lightweight GraphQL generic client
const GraphQLClient = require('graphql-request').GraphQLClient;
const crypto = require('crypto');
const path = require('path');
const api = require('./api_constants');
//GraphQL query string to get all inventory, filtering by a specific dealer
const vehicles = `
allDealerships(filter:{ name:"Wheel Kinetics"}) {
PurpleBooth /
Last active February 7, 2023 04:16
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


protrolium /
Last active February 5, 2023 17:21
ffmpeg guide


Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

felixjones /
Last active January 15, 2023 10:01
PMX (Polygon Model eXtended) 2.0, 2.1 File Format Specifications

PMX (Polygon Model eXtended) 2.1

This is an English description of the .PMX file format used in Miku Miku Dance (MMD).

PMX is the successor to the .PMD format (Polygon Model Data).

This is work-in-progress! Please leave feedback in the comments.


dreispt /
Created November 19, 2014 11:04
Odoo Shell: run Odoo commands without a server RPC connection
Assuming Odoo 8.0 sources at ~/odoo:
$ cp ~/odoo
$ cd ~/odoo
$ python -i
Usage example:
>>> env = connect('my-db-name')
>>> Users = env['res.users']
zer4tul / 提问的智慧.md
Last active February 3, 2023 06:24
Simplified Chinese edition of "How To Ask Questions The Smart Way"
View 提问的智慧.md
thomasfr / autossh.service
Last active January 10, 2023 00:08
Systemd service for autossh
View autossh.service
Description=Keeps a tunnel to '' open
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)
Nagyman /
Last active December 23, 2022 23:00
Workflows in Django

Workflows (States) in Django

I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.

Common Software Uses

  • Publishing (Draft->Approved->Published->Expired->Deleted)
jo /
Last active February 4, 2023 04:24
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.


This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.