Skip to content

Instantly share code, notes, and snippets.

View mimi89999's full-sized avatar

Michel Le Bihan mimi89999

View GitHub Profile
import java.awt.Color
import java.io.File
import javax.imageio.ImageIO
import kotlin.math.roundToInt
const val N = 1.0
fun main(args: Array<String>) {
val img = ImageIO.read(File(args[0]))
val map = Array(img.width) { arrayOfNulls<Vector>(img.height) }
@Nothing4You
Nothing4You / ..readme.md
Last active February 12, 2022 19:32
PHP file upload script for Prosody mod_http_upload_external

This script is based on https://hg.prosody.im/prosody-modules/file/f86478a02b25/mod_http_upload_external/share.php

It also supports using the file as index.php to allow stripping the php file from urls:

https://files.xmpp.msg.lol/6186af39-cc50-486e-9bc6-7f40143a62f7/pexels-photo-126407.jpeg
or
https://files.xmpp.msg.lol/index.php/6186af39-cc50-486e-9bc6-7f40143a62f7/pexels-photo-126407.jpeg

It has been changed to include proper caching headers (working with the cronjob below) to allow caching a file until it gets deleted. It also sends files with their mime type to allow displaying supported formats directly in the browser or inline in xmpp clients.

@mxwright
mxwright / instarss.php
Last active May 19, 2021 15:45 — forked from jonathanbell/Instarss.md
Make a RSS feed from an Instagram user's username.
<?php
if (!isset($_GET['user'])) {
if (!isset($_GET['hashtag'])) {
exit('Not a valid RSS feed. You didn\'nt provide an Instagram user or hashtag. Send one via a GET variable. Example .../instarss.php?user=snoopdogg');
}
}
if (isset($_GET['user']) && isset($_GET['hashtag'])) {
exit('Don\'t request both user and hashtag. Request one or the other.');
@jonathanbell
jonathanbell / Instarss.md
Last active March 18, 2023 00:03
August 28 2014 - InstaRss

Instarss

I was looking around for a way to get a user's public Instagram feed as an RSS feed without using the Instagram API when I came across this question on Stack Overflow.

Probably the best way to do this, would be to use the Instagram API. However, I had no desire to sign up for an Instagram account.

Initially, this answer on Stack Overflow suited my needs quite well. However, as fate would have it, Instagram changed its HTML output and the page's JSON data structure changed. Since the idea is quite simple (we're just screen scrapping here) I decided to write my own script. If this works well for you, consider upvoting my answer on Stack Overflow: http://stackoverflow.com/a/25559442/1171790


@Zash
Zash / mod_s2s_certinfo.lua
Last active July 20, 2016 13:18
Riddim plugin for showing info about certificates along with server-side support plugin.
local xmlns = "http://zash.se/protocol/s2scertinfo";
local st = require"util.stanza";
-- local dump = require"myserialize".serialize;
local base64_encode = require"util.encodings".base64.encode;
local s_char, s_gsub = string.char, string.gsub;
local tonumber = tonumber;
local function unhexbyte(c) return s_char(tonumber(c, 16)) end
local function unhex(s) return s_gsub(s, "..", unhexbyte) end
local function hex2b64(s) return base64_encode(unhex(s)) end