This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Simple Bot to reply to Telegram messages | |
# This program is dedicated to the public domain under the CC0 license. | |
""" | |
This Bot uses the Updater class to handle the bot. | |
First, a few handler functions are defined. Then, those functions are passed to | |
the Dispatcher and registered at their respective places. | |
Then, the bot is started and runs until we press Ctrl-C on the command line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::ShoeBox:shoebox.plugin.spriteSheet::PluginCreateSpriteSheet:{ | |
"fileFormatLoop":"\\t{\\n\\t\\t\"filename\":\"@id\", \\n\\t\\t\"frame\": {\"x\":@x, \"y\":@y, \"w\":@w, \"h\":@h},\\n\\t\\t\"anchor\": {\"x\":0,\"y\":1}\\n\\t}@,\\n", | |
"texCropAlpha":true, | |
"fileFormatOuter":"{\\n\"frames\": [\\n@loop\\n],\\n\"meta\": {\\n\\t\"size\": {\"w\": @W, \"h\": @H},\\n\\t\"scale\": \"1\"\\n}\\n}", | |
"useCssOverHack":false, | |
"fileName":"sprites.js", | |
"texPadding":1, | |
"texExtrudeSize":0, | |
"scale":1, | |
"renderDebugLayer":false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// code by https://www.nayuki.io/res/convex-hull-algorithm/convex-hull.js | |
// Returns a new array of points representing the convex hull of | |
// the given set of points. The convex hull excludes collinear points. | |
// This algorithm runs in O(n log n) time. | |
// eslint-disable-next-line import/prefer-default-export | |
export const makeHull = (points) => { | |
const newPoints = points.slice(); | |
newPoints.sort(comparePoints); | |
return makeHullPresorted(newPoints); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useRef } from 'react'; | |
function MatrixBackground({ timeout = 50 }) { | |
const canvas = useRef(); | |
useEffect(() => { | |
const context = canvas.current.getContext('2d'); | |
const width = document.body.offsetWidth; | |
const height = document.body.offsetHeight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HtmlFileInput { | |
constructor({ | |
scene, | |
spriteKey, | |
}) { | |
// Phaser's parent HTML element | |
const mainElement = scene.sys.game.canvas.parentElement; | |
// create html input type | |
const fileInput = document.createElement('input'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import unidecode | |
import pprint | |
import json | |
import yaml | |
import os | |
PHP_ARRAYS = "<?php $redirect_map = [" | |
TAGS = [] | |
CATEGORIES = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const pageQuery = graphql` | |
query Posts($locale: String) { | |
allMarkdownRemark( | |
filter: { | |
fields: { locale: { eq: $locale } } | |
frontmatter: { show: { eq: true } } | |
} | |
sort: { fields: [frontmatter___date], order: DESC } | |
) { | |
edges { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
...config, | |
plugins: [{ | |
resolve: 'gatsby-plugin-intl', | |
options: { | |
path: `${__dirname}/src/intl`, | |
languages: ['en', 'pt-br'], | |
defaultLanguage: 'en', | |
redirect: true, | |
redirectComponent: require.resolve('./src/utils/redirect.js'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to GitHub Pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable import/no-extraneous-dependencies */ | |
const { packAsync } = require('free-tex-packer-core'); | |
const path = require('path'); | |
const { readFileSync, readdirSync, writeFileSync } = require('fs'); | |
const SOURCE_SPRITES_PATH = path.resolve(__dirname, 'original-files', 'sprites'); | |
const SPRITES_PATH = path.resolve(__dirname, 'assets', 'sprites'); | |
// TODO make it possible to generate only one new asset with `node generate-atlas-files.js assetName` | |
async function generateAtlasFiles(assetName = null) { |
OlderNewer