Skip to content

Instantly share code, notes, and snippets.

@kuri65536
kuri65536 / GenieSDL2basic.gs
Last active July 24, 2020 16:46
Genie SDL sample
[indent=4]
uses
SDL
SDLGraphics
class SDLSample: Object
const SCREEN_WIDTH: int = 640
const SCREEN_HEIGHT: int = 480
const DELAY: int = 100
@kuri65536
kuri65536 / GenieSDL2Texture.gs
Last active October 28, 2017 15:58
GenieSDL2Texture.gs
[indent=4]
uses
SDL
SDLGraphics
class SDLSample: Object
const SCREEN_WIDTH: int = 640
const SCREEN_HEIGHT: int = 480
const DELAY: int = 1
@kuri65536
kuri65536 / GenieArray.gs
Created October 29, 2017 02:53
GenieArray
a
@kuri65536
kuri65536 / GenieFileRead.gs
Last active November 1, 2017 23:53
Reading a text file with Genie Language
[indent=4]
init
try
var fp = FileStream.open("sample.txt", "r")
line: string
while ((line = fp.read_line()) != null)
stdout.printf(line + "\n")
except
return
" commit {{{1
function! _vcs_commit(diff, logs)
let l:seq = []
for item in systemlist("echo $_VCSTGT")
if item=~#"^/"
continue
endif
if item=~#"^-"
continue
endif
@kuri65536
kuri65536 / Google_AIY_without_HAT_and_its_setup.md
Last active May 26, 2018 14:33
Google AIY without HAT and its setup

[toc]

Google AIY without HAT and its setup

I made the Google AIY voice kit without HAT. Thanks to great Hackaday article !

However some of the files are changed from 17/05/30. Some steps were changed from hackaday article and I changed the few things.

@kuri65536
kuri65536 / Accordion_list_with_css.md
Last active February 12, 2018 03:56
Accordion list with CSS

live sample in bl.ocks.org

There are some tips in this sample.

  • CSS: nth-child and it's ranging
  • CSS: transition opacity and top properties. (I tested with display property, too)
  • CSS: override nth-child properties by :not() peseudo attribute. (specifiticy)
  • javascript: scroll to element.
  • javascript: forEach on Array-like object.
@kuri65536
kuri65536 / FreeCAD Macro, Export Group to STL.py
Created February 17, 2018 19:20
FreeCAD Macro, Export Group to STL
# -*- coding: utf-8 -*-
import os
import FreeCAD
import Mesh
__objs__ = Gui.Selection.getSelection()
if len(__objs__) > 0:
fname = FreeCAD.ActiveDocument.FileName
dname = os.path.dirname(fname)
fname, fext = os.path.splitext(os.path.basename(fname))
@kuri65536
kuri65536 / iptables_allow_hpprinter.sh
Last active May 13, 2024 13:36
iptables allow ports commands for HP Printer
if1=br0
if2=wlan1
net=192.168.2.0/24
ip=192.168.2.2
iptables -I FORWARD -i $if1 -o $if2 -s $net -d $ip -p udp -m multiport \
--dports 80,137,138,161,427,443,5222,5223,5297,5298,5353 \
-m state --state NEW -j ACCEPT
iptables -I FORWARD -i $if1 -o $if2 -s $net -d $ip -p tcp -m multiport \
--dports 80,137,139,427,443,5222,5223,5297,5298,5353,9100,9220,9500 \
-m state --state NEW -j ACCEPT
@kuri65536
kuri65536 / ReportArmbianWithZ69MaxTVBox.md
Last active April 5, 2018 22:57
The results of use Armbian or Libreelec images with my Z69Max TV Box

The box is Z69 Max

vendor: KimTin? LZHOKK?

RAM 3G, Ether 1000M

current choice: Armbian 5.41 + Kernel 3.14.29 + Ubuntu Mate

  • WiFi not work (mine with ether and useful).