Blog

  • jackbox-games

    jackbox-games

    GUI application that selects a random jackbox game based on the number of players from a curated list of favorite games. Will ommit some games if the number of player is odd or even.

    Screenshot 2023-07-31 185145

    Git clone the repository to use it locally via terminal, provided the library requirements are met.

    or download the installer from the releases tab

    TO DO:

    • GUI
    • Package app into executable
    • Add functionality for filtering drawing specific games
    • Improve UI design
    • Settings and preferences
    • Add more games to game list with future jackbox releases (Jackbox pack 10 oct 2023)
    • Add functionality to automatically open game from app
      • input .exe/steam path in the settings menu
      • optionally scan drives for jackbox.exe

    Future work

    Improvements to UX. The game list is curated based on my parties preferences, I would like to add the functionality of being able to select your own game list. The user is presented with the entire game list and tick boxes to make their selection.

    I would also like to add a settings button to adjust some preferences, for example, the app current ommits some games from being chosen based on if the player count is odd or even (this is to ensure fair and even teams), give the user the ability to turn off this feature in the settings.

    Untitled Diagram drawio2

    Visit original content creator repository https://github.com/lukevc/jackbox-games
  • antd-table-infinity

    中文 | English

    antd-table-infinity

    一个基于 Antd Table 的无限滚动加载表格组件,不同普通无限滚动方案,它使用了虚拟滚动技术,拥有无可比拟的高性能!

    –by 客如云(keruyun.com)前端团队

    为什么会有这个库?

    众所周知,Antd Table 组件只有翻页模式,我们需要将其改为滚动无限加载,但是 Antd Table 其本身是基于React.Component继承的,而非PureComponent,所以在大数据下存在严重的性能问题。

    基于虚拟滚动技术,我们实现了无论表格有多少数据,始终只render指定行数的表格,拥有了高性能滚动,理论上支持无限量数据,拥有最佳用户体验。

    本库稍加改动理论上也支任意第三方表格组件!

    运行演示

    • git clone https://github.com/Leonard-Li777/antd-table-infinity.git
    • yarn install
    • yarn run storybook
    • check localhost:9001

    antd-table-infinity gif demo

    兼容说明

    自从 antd-table-infinity@1.1.0 添加了 IntersectionObserver Polyfill, 现在兼容所有主流浏览器!!!

    由于使用了 IntersectionObserver 提高滚动监听性能,支持浏览器如下

    • Chrome 51+
    • Firefox 61+
    • Edge 17+
    • iOS Safari 不兼容

    使用了 React 新的 API getDerivedStateFromProps 等

    • React 16.4.0+

    API 说明


    PageTable (分页无限滚动)

    快速开始


    • npm install antd-table-infinity
    • import { PageTable } from 'antd-table-infinity';
    • import 'antd-table-infinity/index.css';

    使用方法


    antd-table-infinity 导出一个模块 PageTable, 它接收如下props:

    Option default Description
    loading false 表示加载状态,展示loading效果
    loadingIndicator null 自定义一个react组件去展示loading动画,否则使用内置动画
    onFetch noop 加载数据,Fetch数据: function({page, pageSize}) => void
    pageSize 30 每页数据行数
    onScroll null 滚动事件监听 function(e) => void
    pagination { defaultCurrent: 1 } antd 组件 Pagination, 但仅接受如下Props:
    position: oneOf([‘both’, ‘top’, ‘bottom’]),
    className: string,
    defaultCurrent: number,
    hideOnSinglePage: bool,
    itemRender: func,
    showQuickJumper: bool,
    showTotal: func,
    simple: bool,
    size: string,
    onChange: func,
    bidirectionalCachePages Infinity 1 ~ maxPage ,当前页附近双向缓存的页数,最小为1,最大为maxPage,Infinity相当于maxPage
    total 0 数据总条数
    dataSource undefined 格式: [page, data], 当fetch成功,传递给组件的页码和数据
    debug false 是否显示Debug console.log信息
    其它 Antd Table Props

    示例代码


    import React, { Component } from 'react';
    import ReactDOM from 'react-dom';
    import { Spin } from 'antd';
    import { PageTable as Table } from 'antd-table-infinity';
    import { columns, fetchData } from './stories/Table/mockData';
    
    class App extends Component {
      state = {
        page: 1,
        data: [],
        loading: false,
      };
      handleFetch = ({ page, pageSize }) => {
        console.warn('loading', { page, pageSize });
    
        const startIndex = (page - 1) * pageSize;
    
        this.setState({ loading: true });
        fetchData(startIndex, pageSize).then(data =>
          this.setState({
            loading: false,
            data,
            page,
          }),
        );
      };
    
      render() {
        const { page, data, loading } = this.state;
    
        return (
          <Table
            rowKey='key'  // 非常重要,请按你的数据列正确设置,否则滚动会出问题
            className="custom-classname"
            pagination={{
              position: 'both',
              defaultCurrent: 21,
              className: 'custom-classname-pagination',
            }}
            loading={loading}
            onFetch={this.handleFetch}
            pageSize={100}
            bidirectionalCachePages={1}
            total={5000}
            dataSource={[page, data]}
            columns={columns}
            scroll={{ x: 2500, y: 650 }}
            bordered
            debug
          />
        );
      }
    }
    
    ReactDOM.render(
        <App />,
      document.getElementById('root')
    );

    InfinityTable (无限滚动组件)

    快速开始

    • npm install antd-table-infinity
    • import { InfinityTable } from 'antd-table-infinity';

    使用方法

    antd-table-infinity 导出一个模块 InfinityTable, 它接收如下props:

    Option default Description
    loading false 表示加载状态,展示loading效果
    loadingIndicator null 自定义一个react组件去展示loading动画,否则使用内置动画
    onFetch noop 滚动到底部事件回调,Fetch数据: function() => void
    pageSize 30 表格实际render行数
    onScroll null 滚动事件监听 function(e) => void
    debug false 是否显示Debug console.log信息
    其它 Antd Table Props

    示例代码

    import React, { Component } from 'react';
    import ReactDOM from 'react-dom';
    import { Spin } from 'antd';
    import { InfinityTable as Table } from 'antd-table-infinity';
    import { columns, fetchData } from './stories/Table/mockData';
    
    class App extends Component {
      state = {
        data: [],
        loading: false,
      };
      handleFetch = () => {
        console.log('loading');
        this.setState({ loading: true });
        fetchData(this.state.data.length).then(newData =>
          this.setState(({ data }) => ({
            loading: false,
            data: data.concat(newData),
          })),
        );
      };
    
      loadMoreContent = () => (
        <div
          style={{
            textAlign: 'center',
            paddingTop: 40,
            paddingBottom: 40,
            border: '1px solid #e8e8e8',
          }}
        >
          <Spin tip="Loading..." />
        </div>
      );
    
      render() {
        return (
          <Table
            rowKey='key'  // 非常重要,请按你的数据列正确设置,否则滚动会出问题
            loading={this.state.loading}
            onFetch={this.handleFetch}
            pageSize={100}
            loadingIndicator={this.loadMoreContent()}
            columns={columns}
            scroll={{ y: 450 }}
            dataSource={this.state.data}
            bordered
            debug
          />
        );
      }
    }
    
    ReactDOM.render(
        <App />,
      document.getElementById('root')
    );

    SumTable (无限滚动组件, 带合计行)

    antd-table-infinity gif demo

    快速开始

    • npm install antd-table-infinity
    • import { SumTable } from 'antd-table-infinity';
    • import 'antd-table-infinity/index.css';

    使用方法

    antd-table-infinity 导出一个模块 SumTable, 它接收如下props:

    Option default Description
    loading false 表示加载状态,展示loading效果
    loadingIndicator null 自定义一个react组件去展示loading动画,否则使用内置动画
    onFetch noop 滚动到底部事件回调,Fetch数据: function() => void
    pageSize 30 表格实际render行数
    sumData null 合计行数据
    debug false 是否显示Debug console.log信息
    其它 Antd Table Props

    示例代码

    import React, { Component } from 'react';
    import ReactDOM from 'react-dom';
    import { Spin } from 'antd';
    import { SumTable as Table } from 'antd-table-infinity';
    import { columns, fetchData } from './stories/Table/mockData';
    import 'antd-table-infinity/index.css';
    
    class App extends Component {
      state = {
        data: [],
        loading: false,
      };
      handleFetch = () => {
        console.log('loading');
        this.setState({ loading: true });
        fetchData(this.state.data.length).then(newData =>
          this.setState(({ data }) => ({
            loading: false,
            data: data.concat(newData),
          })),
        );
      };
    
      render() {
        return (
          <Table
            rowKey='key'  // 非常重要,请按你的数据列正确设置,否则滚动会出问题
            loading={this.state.loading}
            onFetch={this.handleFetch}
            pageSize={100}
            sumData={sumData}
            size="small"
            columns={columns}
            scroll={{ x: 2500, y: 350 }}
            dataSource={this.state.data}
            bordered
            debug
          />
        );
      }
    }
    
    
    ReactDOM.render(
        <App />,
      document.getElementById('root')
    );

    注意事项

    1. antd-table-infinity是基于Antd Table的上一层封装,因此使用的时候,确保你的项目已安装antd组件库
    • import { InfinityTable, SumTable, PageTable } 'antd-table-infinity'; 只包含表格组件的代码
    • import 'antd-table-infinity/index.css'; 只包含PageTable、SumTable组件的css
    1. 如果你的项目没有安装 antd 组件库, 请使用全量打包文件
    • import { InfinityTable, SumTable, PageTable } from 'antd-table-infinity/dist/index.js'; 包含所有代码及使用到的antd相关组件的所有代码
    • import 'antd-table-infinity/index.css'; 只包含PageTable、SumTable组件的css
    • import 'antd-table-infinity/dist/index.css'; 包含使用到的antd相关组件的所有css
    1. rowKey=’key’ 非常重要,antd-table需要的每行数据的唯一键值,否则滚动翻页会出问题,实在没有,请用 uuid 库创建 参考:https://ant.design/components/table-cn/#%E6%B3%A8%E6%84%8F

    已发现问题

    • 当做单元格编辑功能的时候(如在input中连继输入字符,本质上是 Antd Table 接收新的props的反复渲染),在开发模式下会存在性能问题,生产环境不会存在!主要是来自 HMR 和 Redux DevTools的性能消耗。
    Visit original content creator repository https://github.com/Leonard-Li777/antd-table-infinity
  • ComfyJS

    Comfy.JS

    npm GitHub

    We built this Comfy Twitch Chat Module live on Twitch for Coding Cafe!

    Special Thanks: Comfy.JS is possible thanks to tmi.js maintained by @AlcaDesign

    Comfy.JS lets you integrate with Twitch chat for your Twitch channel SUPER EASILY in just a few lines of code. Here’s a quick 3-min video on how to use it: (Click image to open video)

    ComfyJS How-To Video

    Instafluff

    Like these projects? The best way to support my open-source projects is by becoming a Comfy Sponsor on GitHub!

    https://github.com/sponsors/instafluff

    Come and hang out with us at the Comfiest Corner on Twitch!

    https://twitch.tv/instafluff

    Instructions

    Node

    1. Install comfy.js
    npm install comfy.js --save
    
    1. Respond to !commands your channel
    var ComfyJS = require("comfy.js");
    ComfyJS.onCommand = ( user, command, message, flags, extra ) => {
      if( flags.broadcaster && command === "test" ) {
        console.log( "!test was typed in chat" );
      }
    }
    ComfyJS.Init( "MyTwitchChannel" );

    Browser

    1. Download and add comfy.js from the dist folder or include from the JSDelivr CDN:
    <script src="comfy.min.js"></script>

    OR

    <script src="https://cdn.jsdelivr.net/npm/comfy.js@latest/dist/comfy.min.js"></script>
    1. Respond to !commands your channel
    <html>
      <head>
        <script src="https://cdn.jsdelivr.net/npm/comfy.js@latest/dist/comfy.min.js"></script>
      </head>
      <body>
        <script type="text/javascript">
          ComfyJS.onCommand = ( user, command, message, flags, extra ) => {
            if( flags.broadcaster && command === "test" ) {
              console.log( "!test was typed in chat" );
            }
          }
          ComfyJS.Init( "MyTwitchChannel" );
        </script>
      </body>
    </html>

    Flags

    Currently, the flags possible in onCommand() and onChat() are:

    • broadcaster
    • mod
    • founder
    • subscriber
    • vip
    • highlighted
    • customReward

    Extra Parameter

    Currently, the extra parameter for the onCommand() contains the following fields:

    • id (the message message)
    • channel
    • roomId
    • messageType
    • messageEmotes
    • isEmoteOnly
    • userId
    • username
    • displayName
    • userColor
    • userBadges
    • flags
    • timestamp
    • customRewardId (only works with custom channel rewards with required-text)

    If the message is a command, the extra parameter will contain an additional field:

    • sinceLastCommand

    which contains the information on the time periods in ms since the last time any user, or the specific user, has used the same command. This field can be convenient to be used for setting global cooldown or spamming filters. See examples below:

    ComfyJS.onChat = ( user, message, flags, self, extra ) => {
      if( flags.broadcaster && command === "test" ) {
        if( extra.sinceLastCommand.any < 100 ) {
          console.log(
            `The last '!test' command by any user was sent less than 100 ms ago`
          );            
        }
    
        if( extra.sinceLastCommand.user < 100 ) {
          console.log(
            `The last '!test' command by this specific user (as denoted by the 'user' parameter) was sent less than 100 ms ago`
          );            
        }
      }
    }

    Reading Chat Messages

    You can read chat messages by using the onChat() handler

    ComfyJS.onChat = ( user, message, flags, self, extra ) => {
      console.log( user, message );
    }

    Sending Chat Messages

    Sending Chat Messages can be done through ComfyJS.Say( message ) but requires an OAUTH password when connecting to chat.

    Securely adding your password

    1. Get a Twitch Chat OAuth Password Token – http://twitchapps.com/tmi/
    2. Install dotenv
    npm install dotenv --save
    
    1. Create a file named .env that looks like this:
    TWITCHUSER=[YOUR-USERNAME-HERE]
    OAUTH=[YOUR-OAUTH-PASS HERE] # e.g. OAUTH=oauth:kjh12bn1hsj78445234
    1. Initialize with the Username and OAUTH password
    var ComfyJS = require("comfy.js");
    ComfyJS.onCommand = ( user, command, message, flags, extra ) => {
      if( command === "test" ) {
        ComfyJS.Say( "replying to !test" );
      }
    }
    ComfyJS.Init( process.env.TWITCHUSER, process.env.OAUTH );

    Joining a Different Channel

    You can join a different channel or groups of channels by specifying in the Init()

    Joining a Single Channel

    ComfyJS.Init( "MyTwitchChannel", null, "ChannelToJoin" );

    Joining Multiple Channels

    ComfyJS.Init( "MyTwitchChannel", null, [ "ChannelA", "ChannelB", "ChannelC" ] );

    Channel Point Reward Redemptions

    Channel Point Reward Redemptions require extra Twitch OAuth permission scopes (and must be the OAuth of the channel owner!)

    You can use this tool: https://twitchapps.com/tokengen/

    Scopes: channel:manage:redemptions channel:read:redemptions user:read:email chat:edit chat:read

    Instafluff’s Scopes List: user:read:email user:read:chat chat:edit chat:read user:read:whispers user:manage:whispers channel:read:redemptions channel:read:hype_train channel:read:ads channel:read:charity channel:read:goals channel:read:guest_star channel:read:polls channel:read:predictions moderator:read:chatters moderator:read:followers user:write:chat channel:manage:redemptions moderator:manage:shoutouts channel:manage:polls channel:manage:predictions channel:manage:broadcast channel:manage:raids moderator:manage:announcements moderator:manage:automod moderator:manage:banned_users moderator:manage:chat_messages clips:edit

    ComfyJS.onReward = ( user, reward, cost, message, extra ) => {
      console.log( user + " redeemed " + reward + " for " + cost );
    }

    Comfy.JS includes functions to manage Channel Point Rewards. These functions require the ClientID used in getting the Twitch OAuth password for the channel.

    • GetChannelRewards( clientId, manageableOnly = true )
      • Gets the channel’s rewards
    • CreateChannelReward( clientId, rewardInfo )
      • Creates a channel point reward
    • UpdateChannelReward( clientId, rewardId, rewardInfo )
      • Updates a channel point reward (Only rewards created with this ClientID can be updated)
    • DeleteChannelReward( clientId, rewardId )
      • Deletes a channel point reward (Only rewards created with this ClientID can be deleted)
    let channelRewards = await ComfyJS.GetChannelRewards( clientId, true );
    
    let customReward = await ComfyJS.CreateChannelReward( clientId, {
        title: "Test Reward",
        prompt: "Test Description",
        cost: 100,
        is_enabled: true,
        background_color: "#00E5CB",
        is_user_input_required: false,
        is_max_per_stream_enabled: false,
        max_per_stream: 0,
        is_max_per_user_per_stream_enabled: false,
        max_per_user_per_stream: 0,
        is_global_cooldown_enabled: false,
        global_cooldown_seconds: 0,
        should_redemptions_skip_request_queue: true
    } );
    
    let updatedReward = await ComfyJS.UpdateChannelReward( clientId, customReward.id, {
        title: "Test Reward (Updated)",
        prompt: "Updated Description",
        cost: 200,
        is_enabled: true,
    } );
    
    await ComfyJS.DeleteChannelReward( clientId, customReward.id );

    Disconnecting from Server

    You can disconnect from the server and all channels by using Disconnect().

    ComfyJS.Disconnect();

    All Supported Events

    • onCommand( user, command, message, flags, extra )
      • Responds to “!” commands
    • onChat( user, message, flags, self, extra )
      • Responds to user chatting
    • onWhisper( user, message, flags, self, extra )
      • REQUIRES EXTRA PERMISSION SCOPES
      • Responds to user whisper event
      • Requires one of the following OAuth scopes: user:read:whispers, user:manage:whispers
    • onMessageDeleted( id, extra )
      • Responds to chat message deleted
    • onReward( user, reward, cost, message, extra )
      • REQUIRES EXTRA PERMISSION SCOPES
      • Responds to Channel Point Redemptions
    • onJoin( user, self, extra )
      • Responds to user joining the chat
    • onPart( user, self, extra )
      • Responds to user leaving the chat
    • onHosted( user, viewers, autohost, extra )
      • Responds to channel being hosted
      • Requires being authorized as the broadcaster
    • onBan( bannedUsername, extra )
      • Responds to a user being banned
    • onTimeout( timedOutUsername, durationInSeconds, extra )
      • Responds to a user being timed out
    • onRaid( user, viewers, extra )
      • Responds to raid event
    • onCheer( user, message, bits, flags, extra )
      • Responds to user cheering
    • onSub( user, message, subTierInfo, extra )
      • Responds to user channel subscription
    • onResub( user, message, streamMonths, cumulativeMonths, subTierInfo, extra )
      • Responds to user channel subscription anniversary
    • onSubGift( gifterUser, streakMonths, recipientUser, senderCount, subTierInfo, extra )
      • Responds to user gift subscription
    • onSubMysteryGift( gifterUser, numbOfSubs, senderCount, subTierInfo, extra )
      • Responds to user sending gift subscriptions
    • onGiftSubContinue( user, sender, extra )
      • Responds to user continuing gift subscription
    • onHypeTrain( "begin" | "progress" | "end", level, progressToNextLevel, goalToNextLevel, totalHype, timeRemainingInMS, extra )
      • REQUIRES EXTRA PERMISSION SCOPES
      • Responds to when a Hype Train is happening
      • Requires one of the following OAuth scopes: channel:read:hype_train
    • onShoutout( channelDisplayName, viewerCount, timeRemainingInMS, extra )
      • REQUIRES EXTRA PERMISSION SCOPES
      • Responds to when streamers shoutout another channel
      • Requires one of the following OAuth scopes: moderator:read:shoutouts, moderator:manage:shoutouts
    • onPoll( "begin" | "progress" | "end" | "archive" | "close" | "delete", title, choices, votes, timeRemainingInMS, extra )
      • REQUIRES EXTRA PERMISSION SCOPES
      • Responds to when a stream poll is happening
      • Requires one of the following OAuth scopes: channel:read:polls, channel:manage:polls
      • Choices and votes are sorted by # of votes automatically. Top voted choice(s) will be the first elements in choices and votes
    • onPrediction( "begin" | "progress" | "lock" | "end" | "cancel", title, outcomes, topPredictors, timeRemainingInMS, extra )
      • REQUIRES EXTRA PERMISSION SCOPES
      • Responds to when a stream prediction is happening
      • Requires one of the following OAuth scopes: channel:read:predictions, channel:manage:predictions
    • onConnected( address, port, isFirstConnect )
      • Responds when connecting to the Twitch chat.
    • onReconnect( reconnectCount )
      • Responds when attempting to reconnect to the Twitch chat.
    • onError( error )
      • Hook for Errors

    Credits

    Thank you to all the participants of this project!

    Instafluff, Instafriend, Neo_TA, ChatTranslator, fydo, That_MS_Gamer, MrRayKoma, Amarogine, HunWalk, simrose4u, sparky_pugwash, soggycoffee, blackdawn1980, BooobieTrap, lizardqueen, TastyGamers101, MalForTheWin, SourBeers, Stay_Hydrated_Bot, codeaurora, DutchGamer46, TheHungerService, BungalowGlow, koralina_211, TominationTime, itsDeke, fd_god92, SushiDay, FlyToto_, Docpinecone, katori15, ScrtSolstice, QeraiX, superravemonster, Jwh1o1, Deitypotato, Stobie, Chlapicek99, tehWokes, SuperChihuahua, FranC312, FuriousFur, Moopaloo, CreativeBuilds, donaldwm, Zorchenhimer, Grognardian, ravavyr, Chibigirl24, DR4G0N_S4MUR41, PokemoHero, rekaj3773, cunavrito, TheGeekGeneration, DevMerlin, julieee22, malfunct, blazeninja3, pookiepew, xxMiabellexx, Rlchibi

    Thank you to everyone that helped in turning Comfy.JS into a browser module!

    Instafluff, Instafriend, ChatTranslator, Gilokk0, qbotv3, That_MS_Gamer, KitAnnLIVE, simrose4u, MacabreMan2, LuRiMer313, sparky_pugwash, AbbyFabby, sethorizer, julieee22, Numb3rY, Jwh1o1, baileydale, kevkab, Stay_Hydrated_Bot, DrJavaSaurus, stresstest, BungalowGlow, Dr_Zero, NiteCrawla, fd_god92, DrEriksen, codeheir, Talk2meGooseman, sneelps, cottonsmiles, DutchGamer46, LilyHazel, Kyoslilmonster, guthron, DragosNox, sciondragons, HonestDanGames, Xynal, MerlinLeWizard, FablesGames, BrainoidGames, donaldwm, Gharrotey, RIKACHET, HeyOhKei, DevMerlin, CrimsonKnightZero, ellie_pop, ItsNaomiArt, SomaPills, TheSabbyLife, bktdakid31, IsaisChannel, thegooseofwild, itsDeke, bubblesandunicorns, jellydance, MalForTheWin, Chibigirl24, Pearcington, RikuRinku, rockysenpai24, DEAD_P1XL, codeaurora, EndlessMoonfall, fromtheannex, Optik_Nerve, qerwtr546, REAZNxxx, GoonPontoon, JesseSkinner, roberttables, pookiepew, Lannonbr, SoG_Cuicui, Deitypotato, shalomhanukkahbneishimon, UpmostKek, xeiu, skatesubzero, kingswerv, K1ng440, kaisuke, kinbiko, malfunct, BooobieTrap, Kara_Kim

    Thanks to everyone who joined in on adding Twitch PubSub support for Channel Point Reward Redemptions to Comfy.JS!

    Instafluff, Instafriend, informathemusic, aRandomTim, shadesofpixie, That_MS_Gamer, ToeNeeHee, httpJunkie, ryanchetty_1, calguru, chrislocality, Atanerah, rekaj3773, moshiko777, fizhes, AnnaCodes, Smokestormx, TheGeekGeneration, SavenaV, KotaKlan, rosebutterfly24, Simpathey, Spationaute, DjDesidera, JupiterZky, judybelle1, Shaezonai, shineslove, airsickmammal, walaber, jellydance, LilyHazel, PainArtist, Nickloop_TTV, VerbatimStudios, silversurfer1989, BellaTriXrbsa, holloway87, Asherroth86, Tiwesday, not_your_point, JenDevelops, tenaciousw, Cuicui_off, stevis5, aranhawaii, DevMerlin, wabes1, jeckle, opti_21, sparky_pugwash, tommunist_64, DutchGamer46, DoctorArgus, simrose4u, DreamGardenPanda, onelineofme, stuyksoft, Simployed, JustinZedly, Rhedone, DrMikachu, Gurkenkater, MrDemonWolf, saltipretzelz, MerlinLeWizard, Kurokirisu, Juscekame, FuriousFur, andresurrego, MissNightcrawler, karatewump, DrillsKibo, florinpop17, Axell99Design, Ahmed_Riad_1, Keegan_GDiegen, PortaalGaming, mjewl, cheppy4444dude, Soccerdude4444, klforthwind, penguinian, 10TenArt, Atndesign, DNIStream, LoveSudoNimh, prosto_artem27, lucasnramos, A_Ninja_For_Jesus_Bruh, RedChrisMS, Lineyatronic, Totte292, A_Gold_Fish, ShiDotMoe, tbdgamer, MatthewDGroves, dota2attitude, mistersyntax, SekaCakes, llamakid29, CryptoCoyote, MurdocTurner, JeanValjean80, walpolea, Jessi8712, butschibuuuu, Cmiley6, TheFlamingWings, hehe24h, cryogen_sw, DrJavaSaurus, rota22_, julieee22, bronick16, ScrtSolstice, ghostlupo86, wake_the_beast, williamcameron2, GizmoPugLife, OG24com

    Visit original content creator repository https://github.com/instafluff/ComfyJS
  • Voluum-API

    Voluum-API

    Voluum API documentation can be found here.

    This repository contains the whole ETL pipeline for Voluum data. Starting with making API-requests, thereafter data is transformed and enriched directly in main files. 2 Volum API-request schemas for Python are provided: Countries Report and Campaigns Report.

    To write a proper API-request for Voluum data Chrome Developers tools are used.

    image (Pic was provided by the Voluum Support Team, many thanks to Katarzyna)

    Load the report you need -> visit Network section in Chrome Developers tools -> choose the Name “report? blah-blah-blah” -> Copy -> Copy as cURL(bash). At this point you’ll have the exact request for the report you have created on a dashboard. To convert it to Python request use Postman, this website or any other suitable service.

    The provided batch files (task_LTD.bat & …) are responsible for running the scripts and sending the data directly to GCS storage. Afterwards they run the other BigQuery.py script, which transfers data from GCS to BigQuery.

    Please be aware, that for the proper work of BigQuery.py you need to setup environmental variable with GOOGLE_APPLICATION_CREDENTIALS to get access from the local PC to your project. To create json file with service account key credentials visit: https://cloud.google.com/docs/authentication/production.

    Visit original content creator repository https://github.com/MariiaChernysh/Voluum-API
  • jissues

    Joomla! Issue Tracker

    Build Status

    Drone-CI
    Build Status

    Requirements

    The issue tracker application requires a server running:

    • PHP 7.4
      • PHP’s ext/curl and ext/intl should also be installed
    • MySQL 5.6.51 with InnoDB support (required to support the MySQL utf8mb4 charset)

    The application also has external dependencies installable via Composer and NPM.

    See also: Dependencies.

    Setup

    1. Clone the git repo to where ever your test environment is located or download a ZIP file.
      • Note If you plan to contribute to the project, you might have to use git clone --recursive to get the submodules checked out.
    2. Copy etc/config.dist.json to etc/config.json.
    3. In the etc/config.json file, enter your database credentials and other information.
    4. Run composer install (or the equivalent for your system) to install dependencies from Composer.
    5. From a command prompt, run the install command to set up your database.
      • bin/jtracker install

    If you are making a change to the issue tracker’s web assets, you’ll also need to set up NPM. Please see the Asset Management documentation for more information.

    Verify the installation is successful by doing the following:

    1. View the site in your browser.
    2. Run the get project command to pull issues, issue comments and other information related to the project from GitHub.
      • bin/jtracker get project

    See also: CLI script.

    Virtual Test Environment

    As an alternative method, there is a setup for a virtual test environment using Vagrant and VirtualBox.

    See also: Virtual server documentation

    Using Login with GitHub

    If you want the ‘Login with GitHub’ button to work properly you’ll need to register an app with GitHub. To do this manage your account at github.com and go to the applications page. Create a new application.

    You’ll be asked for the application URL and the callback URL. This can be your test server or your localhost environment. As long as you enter the URL that your localhost app is running on. An example might be http://jissues.local.

    Once you’ve registered the app at GitHub you’ll receive a Client ID and a Client Secret, enter these into your installation’s etc/config.json file, along with your GitHub login credentials. You should now be able to login with GitHub successfully.

    See also: GitHub Authentication

    Support & Discussion

    Visit original content creator repository https://github.com/joomla/jissues
  • brutales

    ╔════════════════════════════════════════[ BRUTALES.XYZ ]════════════════════════════════════════╗
    ║ ██████╗ ██████╗ ██╗   ██╗████████╗ █████╗ ██╗     ███████╗███████╗    ██╗  ██╗██╗   ██╗███████╗║
    ║ ██╔══██╗██╔══██╗██║   ██║╚══██╔══╝██╔══██╗██║     ██╔════╝██╔════╝    ╚██╗██╔╝╚██╗ ██╔╝╚══███╔╝║
    ║ ██████╔╝██████╔╝██║   ██║   ██║   ███████║██║     █████╗  ███████╗     ╚███╔╝  ╚████╔╝   ███╔╝ ║
    ║ ██╔══██╗██╔══██╗██║   ██║   ██║   ██╔══██║██║     ██╔══╝  ╚════██║     ██╔██╗   ╚██╔╝   ███╔╝  ║
    ║ ██████╔╝██║  ██║╚██████╔╝   ██║   ██║  ██║███████╗███████╗███████║    ██╔╝ ██╗   ██║   ███████╗║
    ║ ╚═════╝ ╚═╝  ╚═╝ ╚═════╝    ╚═╝   ╚═╝  ╚═╝╚══════╝╚══════╝╚══════╝    ╚═╝  ╚═╝   ╚═╝   ╚══════╝║
    ╠═══════════════════════════════[ DIGITAL STUDIO | EST. 2022 ]═══════════════════════════════════╣
    ║                                                                                                ║
    ║  >> "Somos la sangre consciente y acelerada que fluye por las arterias de la tecnología.       ║
    ║     No aceptamos la autoridad impuesta desde arriba; dibujamos nuestro propio mapa,            ║
    ║     navegamos fuera de los territorios conocidos. Somos piratas digitales,                     ║
    ║     artistas del código, soñadores cuánticos. El ciberespacio es nuestro lienzo."              ║
    ║                                                                                                ║
    ║                        [█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█]                       ║
    ║                           >>> ART + CODE + CRYPTO + WEB3 + LIBERTY <<<                         ║
    ║                                                                                                ║
    ║                        [█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█]                       ║
    ║                                                                                                ║
    ║  <CODE> 01010100 01001000 01000101 00100000 01000110 01010101 01010100 01010101 01010010  </>  ║
    ║  <CODE> 01000101 00100000 01001001 01010011 00100000 01001110 01001111 01010111 00100001  </>  ║
    ║                                                                                                ║
     ║                              >>> FOUNDER: MARI LIN ★ <<<                                    ║ 
    ║                                                                                                ║
    ╚══════════════════════════[ BREAK THE SYSTEM | REWRITE THE FUTURE ]═════════════════════════════╝
    

    Brutales XYZ – Digital Studio Portfolio Template

    A minimalist, cyberpunk-inspired portfolio template for digital artists and creative studios. This prototype showcases a modern, non-fungible studio aesthetic while maintaining simplicity and effectiveness.

    🚀 Features

    • Responsive single-page design
    • Cyberpunk-inspired aesthetic
    • Social media integration (Discord)
    • Meta tags optimization for social sharing
    • Mobile-friendly layout
    • Custom font integration (Prompt font family)
    • SVG asset support
    • Progressive Web App capable

    📋 Prerequisites

    • Basic knowledge of HTML/CSS
    • Web browser
    • Code editor
    • Basic understanding of web hosting

    🛠 Project Structure

    brutales-xyz/
    ├── assets/
    │   ├── css/
    │   │   └── css.css
    │   └── img/
    │       ├── favicon.ico
    │       ├── discord.svg
    │       └── social.png
    ├── media/
    │   ├── SIF.png
    │   ├── tob.png
    │   └── bxyz.svg
    ├── index.html
    └── who.html
    

    🎨 Customization

    Meta Tags

    Update the following meta tags in index.html to match your studio’s information:

    <meta name="title" content="Your Studio Name">
    <meta name="description" content="Your Studio Description">
    <meta property="og:url" content="your-domain.com">
    <meta property="twitter:url" content="your-domain.com">

    Images

    Replace the following images with your own:

    • assets/img/favicon.ico – Website favicon
    • assets/img/social.png – Social media preview image
    • media/bxyz.svg – Studio logo
    • media/SIF.png and media/tob.png – Featured work images

    🚀 Deployment

    1. Clone this repository
    2. Customize the content and images
    3. Deploy to your preferred hosting service (GitHub Pages, Netlify, Vercel, etc.)

    💻 Local Development

    1. Clone the repository:
    git clone https://github.com/yourusername/brutales-xyz.git
    1. Navigate to the project directory:
    cd brutales-xyz
    1. Open index.html in your browser or use a local development server

    📱 Mobile Optimization

    The template includes mobile-specific meta tags:

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">

    🔗 Links and Integration

    • Update Discord link in index.html:
    <a href="https://discordapp.com/users/YOUR-DISCORD-ID/">

    🎨 Styling

    The template uses a custom CSS file (assets/css/css.css) for styling. Modify this file to match your brand’s aesthetic.

    📝 License

    This project is open source and available under the MIT License.

    🤝 Contributing

    1. Fork the repository
    2. Create your feature branch (git checkout -b feature/AmazingFeature)
    3. Commit your changes (git commit -m 'Add some AmazingFeature')
    4. Push to the branch (git push origin feature/AmazingFeature)
    5. Open a Pull Request

    💫 About Brutales XYZ

    Brutales XYZ is a digital art and advertising studio that combines creativity with technology. The studio specializes in various digital services including 3D modeling, web design, game development, and blockchain technology integration.

    📬 Contact


    Made with 💜 by Brutales XYZ

    Visit original content creator repository
    https://github.com/sochologa/brutales

  • cvrp-algorithm

    Capacitated Vehicle Routing Problem (CVRP)

    This repository contains solutions for the Capacitated Vehicle Routing Problem (CVRP), a classic optimization problem in logistics and transportation. The CVRP involves determining the optimal set of routes for a fleet of vehicles to deliver goods to a set of customers, starting and ending at a depot. Each vehicle has a maximum capacity, and the goal is to minimize the total distance traveled while ensuring that the demand of each customer is met without exceeding the vehicle capacities.

    Implemented Algorithms

    Random Search

    Generates random solutions to the CVRP by randomly selecting customers for the routes, ensuring the capacity constraint is respected. It evaluates multiple random solutions and selects the best one.

    Greedy Search

    Constructs a solution incrementally by always selecting the nearest customer that doesn’t violate the capacity constraint.

    There are 2 implemented versions:

    • Standard: Constructs a solution incrementally by always selecting the nearest customer that doesn’t violate the capacity constraint.
    • Randomized Greedy Search: Adds randomness by sometimes selecting one of the k-nearest customers instead of the nearest, to explore different potential solutions.

    Tabu Search

    An iterative optimization method for the CVRP that explores neighboring solutions by making local changes, such as swapping customers between routes. It uses a tabu list to avoid revisiting recently explored solutions, enhancing the search for a global optimum. The best solution found during the process is selected.

    Genetic Algorithm

    An evolutionary algorithm inspired by natural selection.

    Initial Population:

    The initial population consists of solutions where 80% are generated using a greedy heuristic approach, and 20% are randomly generated solutions.

    Selection (Tournament Selection):

    Tournament selection is used to choose parent solutions based on their fitness scores. Each tournament selects a subset of solutions randomly and picks the best-performing solution among them.

    Crossover (Ordered Crossover – OX):

    Ordered crossover combines genetic material from two parent solutions to create new offspring.

    Steps

    1. Flattening Parents: Parents are flattened into linear lists of nodes.

    2. Crossover Points: Two points are randomly chosen within these lists.

    3. Creating Offspring: Offspring inherit a segment from one parent and fill the rest with nodes from the other parent, ensuring all nodes are included while respecting vehicle capacity constraints.

    Mutation (Swap Mutation):

    Swap mutation randomly exchanges positions of nodes within routes in offspring solutions.

    Fitness Criteria

    Fitness is computed using the formula:

    fitness = alpha * total_distance + beta * number_of_vehicles
    

    where total_distance represents the total travel distance of all vehicles in the solution, and number_of_vehicles is the count of vehicles used.
    Alpha (𝛼) and Beta (𝛽) are coefficients that balance the importance between minimizing total distance and minimizing the number of vehicles, respectively. Lower fitness values indicate better solutions.

    Customizing Experiments

    Running All Algorithms

    To run all algorithms, use the run_all function. This function executes all algorithms on the specified problem instance and reports the best, worst, and average fitness across multiple executions. You have the flexibility to adjust all algorithm parameters dynamically by providing them as arguments when invoking the .run() method.

    Running Experiments for the different parameters

    You can customize the parameters (population_size, crossover_rate, mutation_rate) by modifying the respective arrays in the main script and using the run_experiment function. This function iterates over the specified parameter values, runs the GA with each value, and records the best, worst, and average fitness in separate CSV files for analysis.

    Visit original content creator repository
    https://github.com/murad-sh/cvrp-algorithm

  • polymerts-doc-generator

    polymerts-doc-generator

    This is a node module for parsing a TypeScript file (PolymerTS) and generating an empty documentation file (i.e. no code, only signatures) compatible with Polymer 1.0 to pass to iron-component-page for documentation. While we try to fill in anything that may be missing in the line of comments when we can, well documented code is both benefecial to new developers coming into the project as well as seasoned developers trying to remember why they may have done something the way they did when returning to a project.

    Background Info

    Since Red Pill Now changed our process to use TypeScript for components we lost the auto-generated documentation feature for our components. This node module attempts to restore that feature.

    While we understand that the format generated here is for Polymer 1.0. Once we move to Polymer 2.0 we will need to revisit all the models to change how they are rendered. This should not be a big undertaking.

    Setup

    First, make sure you have Node.js installed, so we can use the Node Package Manger (NPM). Next install the other key tools:

    Install

    npm install polymerts-doc-generator

    Usage

    var polymerTsDoc = require('polymerts-doc-generator');
    /**
     * @param {string} pathToTsFile - The path to the file we want to parse
     * @param {string} pathToDocFile - The directory where we want to put our documentation files
     */
    var newDocFile = polymerTsDoc.start(pathToTsFile, pathToDocFile);

    This will parse the pathToTsFile and generate the empty documentation file at the path of the pathToDocFile. The file name generated will be doc_original-file-name.html.

    The generated file will be suitable for passing to an iron-component-page element.

    Developing

    Clone the project to your local environment and run:

    npm install

    This project is written in typescript. There is a compile script which just runs tsc on the src directory. This will generate .js files in the respective src directories which you can then test/debug.

    Supported Patterns

    In order for this tool to work, there are certain patterns you need to be aware of. Since this project uses the TypeScript compiler to determine all the information about a code block it is fairly accurate and lenient in it’s pattern recognition. If it compiles then theoretically this tool should be able to parse it. Also, any comments for methods, properties, etc. will be included in the generated documentation in the appropriate place.

    Component

    This is the uppermost class. All other parts are stored inside the component. Once all the different parts are collected they are rendered.

    @component('my-component')
    export class MyComponent extends polymer.Base {...}

    The above component definition will be converted to:

    <!-- This is my cool component @demo demo/index.html @hero path/to/hero.png --> <dom-module id="my-component"> <template> <style></style> </template> <script> (function() { Polymer({ is: 'my-component', behaviors: [...], properties: {...}, observers: [...], listeners: {...}, ... }); })(); </script> </dom-module>

    HTML Comments

    The presence of an @demo or @hero tag encountered in a comment block of the HTML File will determine which comment block will be deemed the comment block to use. All other comment blocks will be ignored.

    <link rel="import" href="../polymer/polymer.html"> <link rel="import" href="../polymer-ts/polymer-ts.html"> <!-- This comment will be ignored because it is missing the appropriate tag(s) --> <!-- This is my element's style and example usage documentation @demo demo/index.html --> <dom-module id="my-component"> <template> <style> ... </style> ... </template> </dom-module>

    Properties

    If no comment is defined, one will be created and it will include the @type tag.

    @property({type: Boolean, reflectToAttribute: true})
    propertyName: boolean;
    
    // OR
    
    @property({
    	type: Boolean,
    	reflectToAttribute: true
    })
    propertyName: boolean;

    The above will be transformed to:

    /**
     * propertyName
     * @type {boolean}
     */
    propertyName: {
    	type: Boolean,
    	reflectToAttribute: true
    }

    Behaviors

    Behaviors will be added to a behaviors array.

    @component('my-component')
    @behavior(Polymer['AppLocalizeBehavior']);
    export class MyComponent extends polymer.Base {...}
    
    // OR
    
    @component('my-component')
    @behavior(Polymer.AppLocalizeBehavior);
    export class MyComponent extends polymer.Base {...}

    The above would be transformed to an array and placed in the component structure:

    is: 'my-component',
    behaviors: [
    	Polymer['AppLocalizeBehavior'],
    	Polymer.AppLocalizeBehavior
    ],
    ...

    Observers

    If an observer has only 1 parameter defined, that property will need to be defined as a @property. We will add an observer definition to that @property definition

    @observe('propertyName')
    _onPropertyName(propertyName) {...}
    
    // OR
    
    @observe('propertyName,otherPropertyName')
    _onPropertyName(propertyName, otherPropertyName) {...}

    The above will be transformed to:

    propertyName: {
    	type: Boolean,
    	reflectToAttribute: true,
    	observer: '_onPropertyName'
    }
    _onPropertyName(propertyName) {...}
    
    // OR
    
    observers: [
    	'_onPropertyName(propertyName,otherPropertyName)'
    ],
    _onPropertyName(propertyName,otherPropertyName) {...}

    Computed Property

    A new property will be created pointing to the propertyName method.

    @computed()
    propertyName(someOtherProp) {...}
    
    // OR
    
    @computed({type: String})
    propertyName(someOtherProp) {...}

    The above computed property will be transformed to: (NOTE) Notice the type is Object. This will be the default if type is not defined in the decorator

    propertyName: {
    	type: Object,
    	computed: 'propertyName(someOtherProp)'
    }
    propertyName(someOtherProp) {...}
    
    // OR
    
    propertyName: {
    	type: String,
    	computed: 'propertyName(someOtherProp)'
    }
    propertyName(someOtherProp) {...}

    Listener

    If an @listener is defined and there is not a comment, a comment will be created with an @listens tag. If there is a comment with no @listens tag, we add an @listens tag.

    @listener('someElementId.some-event')
    _onSomeEvent(evt: CustomEvent) {...}
    
    // OR
    
    @listener(SomeNameSpace.SOME_EVENT)
    _onSomeEvent(evt: CustomEvent) {...}

    The above Listener will be transformed to:

    listeners: {
    	'SomeNameSpace.SOME_EVENT': '_onSomeEvent',
    	'someElementId.some-event': '_onSomeEvent'
    }
    /**
     *
     * @listens SomeNameSpace.SOME_EVENT
     * @listens #someElementId.some-event
     */
    _onSomeEvent(evt: CustomEvent) {...}

    Function

    someFunction(arg1: any, arg2: any) {...}
    
    // OR
    /**
     * Some function
     * @param {any} arg1
     * @param {any} arg2
     * @returns {string}
     */
    someFunction(arg1: any, arg2: any): string {...}

    The above functions will be transformed to:

    someFunction(arg1, arg2)
    
    // OR
    
    /**
     * Some function
     * @param {any} arg1
     * @param {any} arg2
     * @returns {string}
     */
    someFunction(arg1, arg2) {...}

    Project Structure

    • polymerts-doc-generator
      • dist/
        • lib/
          • utils.js
        • models/
          • behavior.js
          • comment.js
          • component.js
          • computed.js
          • function.js
          • html-comment.js
          • listener.js
          • observer.js
          • program-part.js
          • property.js
        • index.js
      • src/
        • data/ component files for development/testing purposes
        • docs/ development/testing generated doc files
        • lib/
          • utils.ts
        • models/
          • behavior.ts
          • comment.ts
          • component.ts
          • computed.ts
          • function.ts
          • html-comment.ts
          • listener.ts
          • observer.ts
          • program-part.ts
          • property.ts
        • index.ts
      • .gitignore
      • gulpfile.js
      • package-lock.json
      • package.json
      • README.md
      • tsconfig.json

    Reporting Bugs

    Please use the Issues link in this project. Be descriptive, provide any errors that may have been produced, a snippet of the code that caused the error and if possible how to reproduce the issue.

    Contributing

    Pull Requests are welcome, encouraged and greatly appreciated. When contributing, please follow the same coding style present in the project. Also, if relevant, please provide comments to your changes. If your Pull Request is addressing a feature request or issue, please include the issue # in the commit. For example “Fixes issue: #123”.

    Future Directions

    After some conversations with the team this may be a good starting point for converting a PolymerTS/Polymer 1.x component to a PolmerTS/Polymer 2.x component. Also, converting to Polymer 2.0 should not be that big of a leap. We will just need to change the toMarkup of the models as long as the future PolymerTS 2.x maintains a similar structure.

    Visit original content creator repository
    https://github.com/RedPillNow/polymerts-doc-generator

  • code_and_pepper

    Code & Pepper

    🐍 code I post on the web

    I also share Python/IDE/Software Dev tips on X. The full collection lives here

    Python Spaces on X

    Publications

    2025 Pacific Dataviz Challenge Webinar (10th of June)

    2025 PyData Kampala (22nd of Feb)

    2024 PyCon poster code

    Summary

    The table below describes the content of this repo.v

    Nr Link Code Descriprion
    56 X .ipynb Making a word cloud with Python
    55 X .ipynb Effect of using clip_on parameter on matplotlib artists.
    54 X .ipynb Plot a horn shape in 3D using matplotlib and numpy
    53 X .ipynb Use image as a watermark to in your matplotlib plot
    52 X .ipynb Make a pie chart with matplotlib using the *xkcd* style.
    51 X .ipynb Learn how to use zip and zip_longest in Python.
    50 Twitter/X .ipynb Use matplotlib to plot Olympics logo.
    49 Twitter/X .ipynb Plot a chessboard in Matplotlib (20th of July is International Chess Day.
    48 Twitter/X .ipynb 3 ways to set colour alpha in Matplotlib
    47 Twitter/X .ipynb Minimalistic line plot with dots that have thick border to create a mild impression of discontinuity.
    46 Twitter/X .ipynb Examples showing 4 use cases for else in Python.
    45 Twitter/X .ipynb Add figure description or source of data annotation to a plot using ax.text().
    44 Twitter/X .ipynb Example how to align Matplotlib title to Y axes and add subtitle and some colour accents.
    43 Twitter/X .ipynb Plot of Tweet from @stat_feed: spacex landings
    42 Twitter/X .ipynb Properly plot bar chars when x-values are in date format
    41 Twitter/X .ipynb Learn how to set aspect ratio for the data when plotting it.
    40 Twitter/X .ipynb Plotting vertical, horizontal and angular lines spanning across Axes.
    39 Twitter/X .ipynb Example of how to plot filled contour in matplotlib.
    38 Twitter/X .ipynb Example of how to use CollectionPatch object in matplotlib.
    37 Twitter/X .ipynb My first matplotlib animation (poor code but it works)
    36 Twitter/X .ipynb Presenting 2.5 ways to remove Axes spines
    35 Twitter/X .ipynb Example of using plt.getp() and plt.setp
    34 Twitter/X .ipynb Example of using ax.secondary_xaxis()
    33 Twitter/X .ipynb Updating tick, tick labels and grid colour in matplotlib using ax.tick_params()
    32 Twitter/X .ipynb Merging legends in matplotlib
    31 Twitter/X .ipynb Setting ticks and tick labels in matplotlib
    30 Twitter/X .ipynb 3 ways of how to update matplotlib plot appearance by modifying rcParams
    29 Twitter/X .ipynb Create stacked area plot with hatching fill
    28 Twitter/X .ipynb Show difference betwen ax.set_axis_off() and ax.set_frame_on().
    27 Twitter/X .ipynb Text alignment in matplotlib
    26 Twitter/X .ipynb How to produce an inset plot in matplotlib?
    25 Twitter/X .ipynb Move gridline to the bottom of the plot.
    24 Twitter/X .ipynb Update view of a matplotlib plot created on a 3D Axes
    23 Twitter/X .ipynb How to use display shapely objects using matplotlib
    22 Twitter/X .ipynb How to create an r-style bar plot in matplotlib
    21 Twitter/X .ipynb An example of how to use ax.set method in matplotlib.
    20 Twitter/X .ipynb An example showing different bin options in matpltolib’s histogram plot.
    19 Twitter/X .ipynb Simpson’s paradox example plotted with matplotlib.
    18 Twitter/X .ipynb Demo of 3D plotting capability in matplotlib.
    17 Twitter/X .ipynb Examples of how to plot step lines with and without the shading.
    16 Twitter/X .ipynb Example that shows how to add metadata to a plot while saving it to a file.
    15 Twitter/X .ipynb Example that shows how to set up minor ticks in matplotlib plots.
    14 Twitter/X .ipynb A few examples on how to use zorder in Matplotlib objects.
    13 Twitter/X .ipynb A minimalistic bar chart and stem charts that hilights the key data from Pareto chart for a better story telling.
    12 Twitter/X .ipynb Learn how to plot histograms in Matplotlib.
    11 Twitter/X .ipynb Demonstrate how to use Matplotlib ax.fill_between() plot. Includes using parameters such as where and interpolate.
    10 Twitter/X .ipynb Apply simple tweaks to the Matplotlib line plot to achieve modern look.
    9 Twitter/X .ipynb Example showing the difference between plotting DataFrame with and without parsed dates.
    8 Twitter/X .ipynb Reduce the number of data markers in a plot using markevery= parameter in ax.plot() function.
    7 Twitter/X .ipynb Show GNOME colour palette.
    6 Twitter/X .ipynb See how to use hatching fill in matplotlib plots (scatter, bar, fill_between) and how to tweak hatching options.
    5 Twitter/X .ipynb Add data labels to matplotlib bar chart using ax.bar_label() method as opposed to using ax.text() in a loop
    4 Twitter/X .ipynb Apply simple tweaks to the Matplotlib bar chart to achieve modern look.
    3 Twitter/X .ipynb Take advantage of how Matplotlib interprets None to create good looking drop lines for your line plot.
    2 Twitter/X .ipynb Tips on tweaking matplotlib plot’s axis labels by removing 1st and last tick and using Python f-strings to format the labels text.
    1 N/A .ipynb Horizontal stacked bar chart with lines.


    Visit original content creator repository
    https://github.com/pawjast/code_and_pepper

  • geojson-simplifyer

    Introduction

    This script simplifies the geometry of a GeoJSON file using the “shapely” library. The script takes 3 command line arguments: the input file, output file, and a tolerance value. The tolerance value represents the maximum distance that the simplified geometry can deviate from the original geometry. The script uses the ‘simplify’ method from the shapely library which uses the Douglas-Peucker algorithm, to simplify the geometry and reduce the size of the file.

    Use Case

    • Simplifying large GeoJSON files that are too big to be easily handled and visualized.
    • Improving the performance of data visualization tools like Plotly, Leaflet, and D3, which often have limitations on the size of the data they can handle.
    • Reducing the size of large data sets for faster rendering and better performance.

    Requirements

    • Python 3
    • shapely library
    • json library

    How to Use

    1. Install the required libraries by running “pip install shapely json”
    2. Run the script by providing 3 command line arguments: input file, output file and tolerance value.
    3. The input file should be a valid GeoJSON file. The output file will be the simplified version of the input file.
    4. The tolerance value should be a decimal value between 0 and 1, representing the maximum distance that the simplified geometry can deviate from the original geometry. Default value is 0.009
    5. The script will output the simplified GeoJSON file to the specified output file.

    Note

    • The tolerance value is a critical factor in the simplification process, and the optimal value will depend on the specific data and the desired level of simplification. It’s important to experiment with different tolerance values to find the best balance between file size reduction and accuracy. It’s also worth noting that the tolerance ratio is varying depending on the data, so you might want to adjust it accordingly.
    • This script currently only supports LineString, Point, Polygon, MultiPolygon geometries, if you want to support other geometries you can add it to the script.
    • The script also includes an additional function ‘verifyArgv’ to check if the input, output files are valid but it’s removed as it was not providing any useful information.
    • The script can be used as a command line tool or can be integrated with other scripts to simplify geojson files in bulk.

    Overall, this script is a useful tool for simplifying large GeoJSON files and can help improve the performance of data visualization tools. It’s easy to use and can be integrated with other scripts to simplify large data sets in bulk.

    Visit original content creator repository
    https://github.com/anishdhakal15/geojson-simplifyer