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:
@Uko
Uko / .travis.yml
Created May 16, 2014 06:40
This gist is a Travis-CI config to test Pharo project. Please specify a project name. Also pay attention that you probably have to change repo location. If you have only one version (stable or dev) just delete the line defining $VERSION that you don't need
language: pharo
env:
global:
- PROJECT=<your_project_name>
- REPO=http://www.smalltalkhub.com/mc/Pharo/MetaRepoForPharo30/main
- PHARO=30
matrix:
- VERSION=stable
- VERSION=development
@Uko
Uko / gti-n-cc.st
Last active August 29, 2015 14:01
GTInspector & code city
Gofer new
smalltalkhubUser: 'Moose' project: 'GToolkit';
configuration;
loadDevelopment.
#GTImageSetupCommandLineHandler asClass new
installGTInspector;
installGTPlayground;
disableBreakingCommandPlusOKeybindingsInPharo30.
@Uko
Uko / pharo-fuel.st
Created May 31, 2014 06:27
Snippet showing how to use Fuel serialisation engine in Pharo
"to serialize the object use"
FLSerializer serialize: object toFileNamed: 'file-name.fuel'.
"to deserialize use"
FLMaterializer materializeFromFileNamed: 'file-name.fuel'
TreeModel new
roots: (RPackageOrganizer default packageNamed: 'Vidi') classes;
beCheckList;
autoMultiSelection: true;
multiSelection: true;
autoDeselection: false;
childrenBlock: [ :class | class isClass
ifTrue: [ class methods ]
ifFalse: [ #() ] ];
"hasChildrenBlock: [ :entity | entity isClass ];"
import turtle
def circle(radius = 50, segments = 60):
turn_step = 360 / segments
segment_step = 6.28 * radius / segments
turtle.left(turn_step / 2)
for i in range(segments):
color_step = 2 * i / (segments - 1)
@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" +
@Uko
Uko / criticCollection.st
Created December 8, 2015 13:37
Mining critics
critics := (self
collect:
[ :pharoV |
(pharoV files
reject: [ :criticF | criticF basename = '.done' ]
thenCollect: #basename)
select:
[ :crit |
Smalltalk globals
at: crit asSymbol
@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 / 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>'.