Skip to content

Instantly share code, notes, and snippets.

View YarekTyshchenko's full-sized avatar

Yarek T YarekTyshchenko

View GitHub Profile
@YarekTyshchenko
YarekTyshchenko / Makefile
Created July 31, 2017 10:27
Makefile statsd instrumentation
STATSD_HOST ?= graphite.example.com
STATSD_PREFIX := development.makefile
# Start timer
# $(call start,test.counter)
define start
-@perl -MTime::HiRes=time -we"open my \$$f, '>', '._timing_$(1)'; print \$$f int time * 1000; close \$$f"
endef
# End timer, and send metric
# $(call end,test.counter)
define end
@YarekTyshchenko
YarekTyshchenko / README.md
Last active May 13, 2016 09:48
Search for a makefile upwards recursively

Search Make

This is a script to recursively search for a Makefile deep in a project, and execute the first one that is found. Designed to be used in sublime_text build script:

{
    "shell_cmd": "~/search_make.sh rsync"
}
@YarekTyshchenko
YarekTyshchenko / fish_right_prompt.fish
Created March 9, 2016 13:41
Collection of Fish functions
function fish_right_prompt
if not set -q $DH
echo $DH
else
echo No Dockerhost set
end
end
This file has been truncated, but you can view the full file.
;;; Provided courtesy of http://browscap.org/
;;; Created on Thursday, February 4, 2016 at 12:59 PM UTC
;;; Keep up with the latest goings-on with the project:
;;; Follow us on Twitter <https://twitter.com/browscap>, or...
;;; Like us on Facebook <https://facebook.com/browscap>, or...
;;; Collaborate on GitHub <https://github.com/browscap>, or...
;;; Discuss on Google Groups <https://groups.google.com/forum/#!forum/browscap>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Browscap Version
@YarekTyshchenko
YarekTyshchenko / README.md
Last active February 2, 2016 17:19
Docker lsyncd script

Docker Lsyncd script

Usage:

sync {
    docker,
    source = ".",
 target="container:/path/in/container/",
@YarekTyshchenko
YarekTyshchenko / clover-merge.php
Created February 1, 2016 14:07
Clover XML Merger
<?php
$options = getopt("f:o:");
if (! isset($options['f'])) {
echo "Files have to be specified with -f\n";
exit(1);
}
if (! isset($options['o'])) {
echo "Output has to be specified with -o\n";
exit(1);
}
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) %C(bold green)%ar%C(reset) %C(dim white)%an%C(reset)%C(bold yellow)%d%C(reset) - %C(white)%s%C(reset)' --all
@YarekTyshchenko
YarekTyshchenko / CruiseControl.cs
Last active January 16, 2023 23:45
Collection of Space Engineers C# Scripts
public class CruiseControl {
private double targetSpeed = 0.0;
private bool enabled;
private List<IMyThrust> thrusters = new List<IMyThrust>();
public void setTarget(double targetSpeed) {
this.targetSpeed = targetSpeed;
}
public void addThruster(IMyThrust thruster) {
this.thrusters.Add(thruster);
@YarekTyshchenko
YarekTyshchenko / replicator.cs
Created December 13, 2015 16:11
Replicator Programming
void Main(string argument)
{
string state = LoadState();
if (state == BUILD_IN_PROGRESS) {
if (KernelBuildFinished()) {
WriteText("Build Finished");
SetState(BUILD_FINISHED);
} else {
WriteText("Build in progress");
@YarekTyshchenko
YarekTyshchenko / replicator.sbc
Created December 11, 2015 23:37
Space Engineers Replicator ship
<?xml version="1.0"?>
<Definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ShipBlueprints>
<ShipBlueprint>
<Id>
<TypeId>MyObjectBuilder_ShipBlueprintDefinition</TypeId>
<SubtypeId>replicator</SubtypeId>
</Id>
<DisplayName>yarekt</DisplayName>
<CubeGrids>