Skip to content

Instantly share code, notes, and snippets.

🏠
Let's have fun

Anton Osenenko a0s

🏠
Let's have fun
Block or report user

Report or block a0s

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View human_log.py
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
View gist:1de228f9710e5639a0994ce89f72d187
# https://github.com/dunovank/jupyter-themes
jt -t onedork -T -fs 12 -ofs 11 -f meslo -cellw 100% -altp -lineh 130
@a0s
a0s / Disk Utility (10.10).sh
Last active Jun 25, 2016 — forked from geoff-nixon/Disk Utility (10.10).sh
Continue downloading after interraption
View Disk Utility (10.10).sh
#!/bin/sh -x ## or just ` curl -Ls http://git.io/vRozn | sh `.
## Downloads the Mac OS X 10.10 Recovery Partition update,
## Copy's over the 10.10 version of Disk Utility.app, then
## use git to apply a binary patch so it will run on 10.11+.
cd /tmp
# rm -rf DU1010
mkdir -p DU1010
View brew-cask-cleanup2.rb
#!ruby
# Requirements:
# brew install trash
casks_path = '/opt/homebrew-cask/Caskroom'
if `brew list | grep trash`.empty?
puts 'Please make "brew install trash" before'
exit!
@a0s
a0s / vk_chat_stats.rb
Created Oct 8, 2015
VK chat stats by person
View vk_chat_stats.rb
pp File.read('dump.txt').
scan(/class="mem_link"\starget="_blank">([^<]+)/m).
flatten.
inject(Hash.new(0)) { |total, e| total[e] += 1 ;total}.
map{|k,v| [v, k] }.
sort{|a, b| a[0] <=> b[0] }
@a0s
a0s / brew-cask-cleanup.rb
Last active Sep 18, 2016
Clean (move to trash) old brew cask versions
View brew-cask-cleanup.rb
#!ruby
# Requirements:
# brew install trash
casks_path = '/opt/homebrew-cask/Caskroom'
class Version < Array
def initialize s
super(s.split('.').map { |e| e.to_i })
@a0s
a0s / steps.rb
Created May 5, 2015
Calculate optimal layer heights accordingly screw pitch and stepper motor #reprap
View steps.rb
# Prints the value of the layer height corresponds to a whole number of steps
pitch = 1.25 # mm; 0.8mm for M5, 1.25mm for M8
substeps = 32 # 1,2,4,8,16 for A4988; 1,2,4,8,16,32 for DRV8825
motor_step = 1.8 # deg/step; 0.9 or 1.8 degrees/step
from = 0.00 # mm
to = 0.41 # mm; nozzle size
by = 0.01 # mm
accurate = 4 # decimal digits
View rbenv-install-system-wide.sh
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
You can’t perform that action at this time.