Skip to content

Instantly share code, notes, and snippets.

View mumez's full-sized avatar

Masashi Umezawa mumez

View GitHub Profile
@mumez
mumez / MyApi.gs
Created April 19, 2022 13:39
A very simple API example for GemStone/S
fileformat utf8
set compile_env: 0
! ------------------- Class definition for MyApi
expectvalue /Class
doit
ZnDefaultGsTransactionalServerDelegate subclass: 'MyApi'
instVarNames: #()
classVars: #()
classInstVars: #()
poolDictionaries: #()
@mumez
mumez / tarantalk_box_with_expirationd.lua
Last active March 21, 2018 13:59
Tarantool initialization file with expirationd setup
-- Modules
console = require('console')
queue = require('queue')
http = require('http.client')
json = require('json')
-- Expirationd setup
expirationd = require('expirationd')
function is_expired(args, tuple)
@mumez
mumez / parasol-fixes-for-pharo40-mu.cs
Created November 27, 2015 06:46
Parasol fixes for Pharo 4.0
'From Pharo4.0 of 18 March 2013 [Latest update: #40614] on 24 June 2015 at 5:47:47.355774 pm'!
!BPPharoPlatform methodsFor: 'facade' stamp: 'MasashiUmezawa 6/24/2015 17:44'!
fileDelete: filename
Smalltalk at: #FileDirectory ifPresent: [:cls | ^cls default deleteFileNamed: filename].
filename asFileReference ensureDelete! !
!BPPharoPlatform methodsFor: 'facade' stamp: 'MasashiUmezawa 6/24/2015 17:03'!
jsonRead: aString
#import <Foundation/Foundation.h>
#import "SUYScratchPresentationSpace.h"
@interface ScratchIPhonePresentationSpace (PyonTalk)
//Smalltalk actions
- (IBAction) keyBackspace: (id) sender;
- (IBAction) keyEnter: (id) sender;
- (IBAction) keyEscape: (id) sender;
'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 23 December 2014 at 12:20:55 pm'!
!IPhoneScratchProxy methodsFor: '*PyonTalk-actions-override' stamp: 'mu 12/18/2014 23:16'!
setViewModeIndex: viewModeNumber
"[self basicSetViewModeIndex: viewModeNumber] fork"
viewModeNumber caseOf: {
[0]->[Transcript open].
[1]->[Workspace open].
[2]->[Browser openBrowser].
SystemOrganization addCategory: #AdvMessageInterceptor!
ProtoObject subclass: #AdvMessageInterceptor
instanceVariableNames: 'originalObject'
classVariableNames: ''
poolDictionaries: ''
category: 'AdvMessageInterceptor'!
!AdvMessageInterceptor class methodsFor: 'instance creation' stamp: 'mu 12/13/2014 21:20'!
on: anOriginalObject
@mumez
mumez / uglifyAmber.sh
Created May 24, 2013 12:19
Make Amber Smalltalk deploy.js files into one file by uglifyjs
#! /bin/sh
files='Kernel-Objects.deploy.js Kernel-Classes.deploy.js Kernel-Methods.deploy.js Kernel-Collections.deploy.js Kernel-Exceptions.deploy.js Kernel-Transcript.deploy.js Kernel-Announcements.deploy.js Canvas.deploy.js'
opts='-v -o'
uglifyjs $files $opts amberKernel.js
@mumez
mumez / EcShootingGameExample.st
Created May 17, 2013 06:21
EnchantFromAmber shooting game example
EcSprite subclass: #EcExampleApple
instanceVariableNames: ''
package: 'Enchant-Examples'!
!EcExampleApple methodsFor: 'initialization'!
initialize
self extent: 16@16.
self imageName: 'icon0.png'.
self frame: 15.
@mumez
mumez / EcTouchEventExample.st
Last active February 25, 2016 10:23
EnchantFromAmber touch event handling example
EcGameProgram subclass: #EcTouchEventExample
instanceVariableNames: ''
package: 'Enchant-Examples'!
!EcTouchEventExample methodsFor: 'actions'!
prepareBeforeLoad
self game assetsBasePath: './game-img/'.
self game preloadAssets: #('chara1.png' 'icon0.png').
self game fps: 20.
@mumez
mumez / EcTimelineExample1.st
Last active February 25, 2016 10:23
Upcoming EnchantFromAmber example
EcGameProgram subclass: #EcTimelineExample
instanceVariableNames: ''
package: 'Enchant-Examples'!
!EcTimelineExample methodsFor: 'actions'!
prepareBeforeLoad
self game assetsBasePath: './game-img/'.
self game preloadAssets: #('chara1.png').
self game fps: 20.