Skip to content

Instantly share code, notes, and snippets.

View KateLin-BASIC's full-sized avatar

Kate Lin KateLin-BASIC

View GitHub Profile
| file fileContent |
file := 'test.png' asFileReference.
fileContent := ZnClient new
url: 'https://pharo.org/web/files/pharo.png';
get.
file ensureCreateFile.
file binaryWriteStreamDo: [ :stream | stream nextPutAll: fileContent ]
@KateLin-BASIC
KateLin-BASIC / PharoQuickSetup.st
Last active December 25, 2022 10:22
Pharo 개발 환경의 빠른 구성을 위해 작성된 작은 스크립트입니다.
"''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''"
" _____ _ ____ _ _ _____ _ _ "
" | __ \ | | / __ \ (_) | | / ____| | | | | "
" | |__) || |__ __ _ _ __ ___ | | | | _ _ _ ___ | | __| (___ ___ | |_ _ _ _ __ ___ | |_ "
" | ___/ | '_ \ / _` || '__|/ _ \ | | | || | | || | / __|| |/ / \___ \ / _ \| __|| | | || '_ \ / __|| __|"
" | | | | | || (_| || | | (_) || |__| || |_| || || (__ | < ____) || __/| |_ | |_| || |_) |_ \__ \| |_ "
" |_| |_| |_| \__,_||_| \___/ \___\_\ \__,_||_| \___||_|\_\|_____/ \___| \__| \__,_|| .__/(_)|___/ \__|"
" | | "
" |_| V 0.5 "
"''''''
@KateLin-BASIC
KateLin-BASIC / Color.st
Created April 3, 2022 09:21
Color class in Pharo
"Red"
Color red.
"Green"
Color green.
"Blue"
Color blue.
"RGB"
@KateLin-BASIC
KateLin-BASIC / GrowlMorph.st
Created April 3, 2022 09:19
Show GrowlMorph in Pharo
GrowlMorph
openWithLabel: 'Hello!'
contents: 'This is a Description.'
color: (Color darkGray)
@KateLin-BASIC
KateLin-BASIC / ZincExample.st
Created April 3, 2022 09:09
ZnEasy & ZnClient
"ZnEasy"
(ZnEasy getPng: 'https://pharo.org/web/files/pharo.png') asMorph openInWindow
"ZnClient"
ZnClient new
url: 'https://pharo.org';
get.
@KateLin-BASIC
KateLin-BASIC / ForAndForeach.st
Created April 3, 2022 09:05
For & Foreach in Pharo
| array |
"For (With variable)"
1 to: 10 do: [ :i | Transcript show: i; cr ].
"For (Without variable)"
10 timesRepeat: [ Transcript show: 'Iterating...'; cr ].
"Foreach"
array := #(Bill Zoey Louis Francis).
@KateLin-BASIC
KateLin-BASIC / LiteralArrayAndDynamicArray
Created April 3, 2022 08:59
Creation of Literal Array And Dynamic Array in Pharo
| literal dynamic dynamicWithSemanticSugar |
literal := #(Bill Zoey Louis Francis).
dynamic := (Array new: 4)
at: 1 put: 'Bill';
at: 2 put: 'Zoey';
at: 3 put: 'Louis';
at: 4 put: 'Francis'.
dynamicWithSemanticSugar := { 'Bill'. 'Zoey'. 'Louis'. 'Francis' }
@KateLin-BASIC
KateLin-BASIC / CreateAndWrite.st
Created April 3, 2022 08:30
Create & Write File in Pharo
| file |
file := 'filename.txt' asFileReference.
file ensureCreateFile.
file writeStreamDo: [ :stream | stream nextPutAll: 'Hello, World!' ]