Skip to content

Instantly share code, notes, and snippets.

View SergeStinckwich's full-sized avatar
🎯
Focusing

Serge Stinckwich SergeStinckwich

🎯
Focusing
View GitHub Profile
@bjartwolf
bjartwolf / color.st
Created June 8, 2014 11:14
Change color of Rapiro from Pharo
sPort := SerialPort new.
sPort baudRate: 57600.
sPort close.
sPort openPort: '/dev/ttyAMA0'.
sPort nextPutAll: '#PR010G255B255T001'.
@SeanTAllen
SeanTAllen / gist:952748
Created May 3, 2011 02:57
Ugly pharo dumping to redline format
class := TestCase.
aStream := String new writeStream .
class superclass == nil
ifTrue: [aStream nextPutAll: 'ProtoObject']
ifFalse: [aStream nextPutAll: class superclass name].
aStream
nextPutAll: class kindOfSubclass;
store: class name;
crlf.
@SergeStinckwich
SergeStinckwich / gist:1008000
Created June 4, 2011 15:51
One liners in Smalltalk
"Smalltalk version of http://solog.co/47/10-scala-one-liners-to-impress-your-friends/ "
"1. Multiple Each Item in a List by 2"
(1 to: 10) * 2.
"2. Sum a List of Numbers"
"Version 1"
(1 to:1000) reduce:[:a :b|a+b].
"Version 2"
(1 to:1000) sum.
@frankshearar
frankshearar / gist:1632449
Created January 18, 2012 11:01
Bootstrapping LanguageBoxes from Squeak 4.3
"===== Set up Squeak's compiler correctly ====="
Scanner prefAllowUnderscoreSelectors: true.
Scanner allowUnderscoreAsAssignment: false.
"===== Things that Squeak needs from Pharo ====="
Installer cache
addPackage: 'Pharo-Compatibility-fbs.1';
addPackage: 'VB-Regex-AdrianLienhard.48';
install.
@dalehenrich
dalehenrich / whybotherwithgit.md
Created February 27, 2012 04:11
Why bother with git at all?

Philippe,

You are not a party pooper ... these are exactly the kinds of questions I'm looking for They are excellent questions.

I'm going to highlight several of your points and then answer:

"keeping the Monticello and git metadata in sync. For example since it's still Monticello there has to be all the Monticello metadata which is laying around in "strange" files ... makes it quite unlikely that you can edit the source with a

@eMaringolo
eMaringolo / ZnSimpleWebServer.st
Created May 28, 2012 02:18
The simplest hello world server using Zinc HTTP Components <http://zn.stfx.eu/zn/index.html>
(ZnServer startDefaultOn: 1701)
onRequestRespond: [ :request |
ZnResponse ok: (ZnEntity text: 'Hello World!') ]
@Geal
Geal / repl.st
Created May 24, 2011 09:04
A simple command line REPL (run it with a headless image)
OSProcess thisOSProcess stdOut
nextPutAll: 'Welcome to the simple Smalltalk REPL';
nextPut: Character lf; nextPut: $>; flush.
[ |input|
[ input := OSProcess readFromStdIn.
input size > 0 ifTrue: [
OSProcess thisOSProcess stdOut
nextPutAll: ((Compiler evaluate: input) asString;
nextPut: Character lf; nextPut: $>; flush
]
@ibtisamtauhidi
ibtisamtauhidi / SolarSystemSimulator
Last active August 9, 2017 08:17
A simple solar system simulator using Processing
/*
The Solar System Simulator - I
ComputeRaptor.com
Syed I. Tauhidi
*/
import java.util.Date;
// Eccentricity, aphelion (semi-major axis) and inclination, along with
// the radius of planets are stored in the following array
@oliveiraallex
oliveiraallex / tg2p.st
Created July 25, 2018 08:11 — forked from jdevoo/tg2p.st
Not so Terse Guide to Pharo
"**************************************************************************
* Allowable characters: *
* - a-z *
* - A-Z *
* - 0-9 *
* - .+/\*~<>@%|&? *
* - blank, tab, cr, ff, lf *
* *
* Variables: *
* - variables must be declared before use *
@simonmichael
simonmichael / sm-Ledger.st
Created May 3, 2014 17:15
a prototype squeak port of Ledger, 2007
"
prototype ledger file parser in squeak
Simon Michael
test scripts:
s1 := LedgerParserTests sample1 readStream
PositionableStream
2007/10/7 the fairmont sonoma mission inn & spa
expenses:food:dining $11