Skip to content

Instantly share code, notes, and snippets.

View msklywenn's full-sized avatar

Daniel Borges msklywenn

  • Manufacture 43
  • Bordeaux, France
View GitHub Profile
@msklywenn
msklywenn / fetch_steam_leaderboard.php
Last active December 15, 2020 09:50
Fetch & cache steam leaderboards to display on your website
<?php
// ref: https://partner.steamgames.com/doc/webapi/ISteamLeaderboards
$cache_filename = "leaderboard_cache";
$default_leaderboard = "Normal";
if (!file_exists($cache_filename) || time() - filemtime($cache_filename) > 3600)
{
$max = 10; // how many displayed scores
$key = ""; // steam webapi key, to get it: https://partner.steamgames.com/doc/webapi_overview/auth#create_publisher_key
$appid = ""; // your game's app id
// the names and corresponding leaderboard IDs
@msklywenn
msklywenn / MeshLister.cs
Last active August 31, 2018 22:52
Quick mesh "lister" with infos, for unity
public class MeshLister : EditorWindow
{
[MenuItem("Tools/Mesh Lister")]
static void Open() { GetWindow<MeshLister>(); }
struct Info
{
public Mesh mesh;
public int subMeshes;
public int triCount;
@msklywenn
msklywenn / BatchBuilderSettings.cs
Last active May 18, 2022 14:32
Unity Batch Builder
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Version 2, December 2004
//
// Copyright (C) 2004 Sam Hocevar <[email protected]>
//
// Everyone is permitted to copy and distribute verbatim or modified
// copies of this license document, and changing it is allowed as long
// as the name is changed.
//
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
using UnityEngine;
using UnityEngine.Profiling;
using System.Runtime.CompilerServices;
using System.Collections.Generic;
public class VectorTest : MonoBehaviour
{
Vector3[] array;
List<Vector3> list;
const Twitch = require("twitch").default;
const Discord = require("discord.js");
const ChatClient = require("twitch-chat-client").default;
// environment variables to be set for script to run properly
const {
CODE, // generate code with authorization code flow
// see: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#oauth-authorization-code-flow
CLIENT_ID, // client id of twitch app
CLIENT_SECRET, // client secret of twitch app (for token renewal)