Skip to content

Instantly share code, notes, and snippets.

@pojntfx
pojntfx / main.sh
Created May 17, 2021 09:42
Add Go and Node to VSCodium Flatpak
flatpak install flathub org.freedesktop.Sdk.Extension.golang
flatpak install flathub org.freedesktop.Sdk.Extension.node14
flatpak override --env FLATPAK_ENABLE_SDK_EXT=golang,node14 com.vscodium.codium
@Dollyn
Dollyn / Main.kt
Created August 21, 2017 04:19
Kotlin JavaFx example
package dollyn.sak
import javafx.application.Application
import javafx.event.ActionEvent
import javafx.event.EventHandler
import javafx.stage.Stage
import javafx.scene.Scene
import javafx.scene.control.Button
import javafx.scene.layout.StackPane
@doctaphred
doctaphred / ntfs-filenames.txt
Last active March 9, 2024 21:03
Invalid characters for Windows filenames
Information from https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file :
Use any character in the current code page for a name, including Unicode
characters and characters in the extended character set (128–255), except
for the following:
- The following reserved characters:
< (less than)
> (greater than)
@Khobalt
Khobalt / validatePool.brs
Last active May 16, 2017 21:36
This gist demonstrates how to validate the files in a pool against their sha1 hashes.
REM read more about assetPools here: http://docs.brightsign.biz/display/DOC/roAssetPool
REM read more about syncspecs here: http://docs.brightsign.biz/display/DOC/roSyncSpec
REM Sha1's should be calculated on the server and placed into an entry of the sync spec like so:
REM <download>
REM <name>autoplay-Project 1.xml</name>
REM <hash method="SHA1">a8e24dcfb83a694da58bafb3ab763c07ca842baf</hash>
REM <size>7962</size>
REM <link>pool/a/f/sha1-a8e24dcfb83a694da58bafb3ab763c07ca842baf</link>
REM </download>
@Khobalt
Khobalt / roAssetRealizer.brs
Created May 12, 2017 21:39
This gist demonstrates how to safely move a firmware update file to the root of the card from the pool
msqPort = createObject("roMessagePort")
'Defer the watchdog because the system may be tied up for a little while as the transfer commences
msgPort.DeferWatchdog(120)
newSync = createObject("roSyncSpec")
newSync.readFromFile("path/to/newSyncSpec.xml")
assetCollection = newSync.GetAssets("download")
path$ ="/fwUpdate/path/to/pool"
@kfish
kfish / cherrypy-websockets-monitor.py
Last active March 8, 2019 23:37
A cherrypy websockets server to broadcast, eg. for system monitoring
# To use this, you need to implement some class with a read() method, eg.
#
# class MyReader(object):
# def __init__(self, path):
# self.path = path
#
# def read(self):
# with open(self.path, 'r') as f:
# return f.read()
# ...
@Khobalt
Khobalt / networkdetect.brs
Created May 10, 2017 19:20
This gist demonstrates how to detect a network connection on a BrightSign, and only load the application if the network is available
REM
REM
REM This code demonstrates how to detect a network configuration.
REM Read more: http://docs.brightsign.biz/display/DOC/roNetworkHotplug
REM
Sub Main()
networkAvailable = false
'Check ethernet
nc = CreateObject("roNetworkConfiguration", 0)
if type(nc) = "roNetworkConfiguration" then
@jsinai
jsinai / notify.brs
Last active May 11, 2017 19:57
A BrightScript subroutine that displays a message on the screen. Sample usage: Notify("my message", -1)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Delay is in ms. Message will be displayed for this length of time.
' Specify 0 to return immediately, and rely on the parent message loop.
' Specify -1 for infinite display with a local message loop.
Sub Notify(message As String, delay As Integer)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
print message
gaa = GetGlobalAA()
If gaa.tw = invalid Then
videoMode = CreateObject("roVideoMode")
@developit
developit / unistore.js
Last active September 8, 2020 15:13
Update: the newer & better version of this is published: https://github.com/developit/unistore
import { h, Component } from 'preact';
/** Creates a new store, which is a tiny evented state container.
* @example
* let store = createStore();
* store.subscribe( state => console.log(state) );
* store.setState({ a: 'b' }); // logs { a: 'b' }
* store.setState({ c: 'd' }); // logs { c: 'd' }
*/
import sys
import os
from gi.repository import Gtk, Gdk, WebKit
class Browser(Gtk.Window):
def __init__(self, *args, **kwargs):
super(Browser, self).__init__(*args, **kwargs)