Skip to content

Instantly share code, notes, and snippets.

View Uko's full-sized avatar
😎
zajebiście

Yuriy Tymchuk Uko

😎
zajebiście
View GitHub Profile
| builder models |
models := (RPackageOrganizer default packageNamed: 'AST-Core') definedClasses.
models do: [ :class |
class methods do: [ :method |
REPrefs default rules do: [ :rule |
rule validate: method ] ] ].
builder := CCBuilder new description: 'Boxes in packed layout (isometric view)'.
builder packingLayout.
builder shapeBuilder platform
color:
| all dict reverseDict filtered |
"get data from db"
all := (MooseModel root first allAuthors collect: #name) asArray.
"get author relations data"
dict := STON fromString:
(ZnClient new get: 'https://raw2.github.com/Uko/SHubAuthors/master/SHubAuthors.ston').
"create reverse dictionary"
@Uko
Uko / completion.st
Last active December 29, 2015 12:48
My prefs for pharo. Files should reside in ~/Library/Preferences/pharo/
StartupLoader default executeAtomicItems: {
StartupAction
name: 'Code completion setings'
code: [
NECPreferences
enabled: true;
popupShowAutomatic: true;
useController: NECController;
popupShowWithShortcut: Character space shift ]
runOnce: true
@Uko
Uko / PharoWriteFile.st
Created November 26, 2013 15:47
Writing data to file in Pharo
(FileSystem disk workingDirectory / 'temp.txt') writeStream
nextPutAll: 'string to write in file';
close
@Uko
Uko / convert
Last active December 26, 2015 09:59
Generate movie from slides with ffmpeg
width=1920
height=1080
ffmpeg -i visualization/%d.png -c:v libx264 -filter:v "scale=iw*min($width/iw\,$height/ih):ih*min($width/iw\,$height/ih), pad=$width:$height:($width-iw*min($width/iw\,$height/ih))/2:($height-ih*min($width/iw\,$height/ih))/2:0xFFFFFF" -pix_fmt yuv420p z.mov
@Uko
Uko / loadBaseline.st
Last active December 25, 2015 01:59
To load some project with configuration from gofer
Metacello new
baseline: #Project;
repository: 'github://Uko/Project:branch';
load
@Uko
Uko / moveMcRepo.st
Last active December 25, 2015 01:49
Move montichello repository to some other place
"script by Damien Cassou originaly from: https://code.google.com/p/smalltalk-hub/issues/detail?id=12"
| source goSource destination goDestination files destinationFiles |
source := MCHttpRepository location: '<url-to-source-sepository>'.
destination := MCHttpRepository
location: '<url-to-destination-sepository>'
user: '<login>'
password: '<pass>'.
@Uko
Uko / autosave.st
Last active June 17, 2018 10:48
Autosave Pharo image every 10 mins
[
Transcript open.
[true] whileTrue: [
WorldState addDeferredUIMessage: [
SmalltalkImage current saveSession].
(Delay forSeconds: 60) wait]
] forkNamed: 'autosave'
@Uko
Uko / imageget
Last active December 12, 2015 07:38 — forked from tinchodias/imageget
Unarchives into pharo2 dir
#!/bin/bash
# DOWNLOAD THE LATEST IMAGE ===================================================
IMAGE_URL="http://pharo.gforge.inria.fr/ci/image/20/latest.zip"
wget --progress=bar:force --output-document=image.zip $IMAGE_URL
unzip -qo image.zip -d pharo2
rm -rf image.zip
@Uko
Uko / gist:4071330
Created November 14, 2012 10:07
String for parsing ASCII STL 3D format with regex. Normal can be retrieved by groups 1, 4 and 7, vertices by (10, 13, 16), (19, 22, 25), (28, 31, 34)
"facet\\s+?normal" +
"\\s+?(-?\\d+(\\.\\d+([eE][+-]\\d+)?)?)" +
"\\s+?(-?\\d+(\\.\\d+([eE][+-]\\d+)?)?)" +
"\\s+?(-?\\d+(\\.\\d+([eE][+-]\\d+)?)?)" +
"\\s+?outer\\s+?loop" +
"\\s+?vertex" +
"\\s+?(-?\\d+(\\.\\d+([eE][+-]\\d+)?)?)" +
"\\s+?(-?\\d+(\\.\\d+([eE][+-]\\d+)?)?)" +
"\\s+?(-?\\d+(\\.\\d+([eE][+-]\\d+)?)?)" +
"\\s+?vertex" +