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
colorChangeIndex := self detectIndex: [ :s | s = '; PRINT_COLOR_CHANGE' ].
startLines := self first: colorChangeIndex-1.
restLines := self allButFirst: colorChangeIndex + 1.
layerChangeIndex := restLines detectIndex: [ :s | s = ';AFTER_LAYER_CHANGE' ].
endLines := restLines allButFirst: layerChangeIndex.
layerLines := restLines first: layerChangeIndex.
top_d = 107;
wider_ridge_d = 100;
narrower_ridge_d = 92;
bottom_d = 78;
top_h = 18;
h = 80;
@Uko
Uko / mast
Created October 2, 2018 08:44
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name mastodon-test.tymchuk.me;
root /home/mastodon/live/public;
| methods size |
methods := (RPackage organizer packages select: [ :p | p packageManifestOrNil isNil]) flatCollect: #methods.
size := methods size *
(ReRuleManager uniqueInstance methodRules size +
ReRuleManager uniqueInstance nodeRules size).
(1 to: 10) collect: [ :x |
[ methods do: [ :m | m critiques ] ] timeToRunWithoutGC / size ].
@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
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)
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 ];"
@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'
@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 / .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