This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ruby2d' | |
require 'delegate' | |
set( | |
title: 'arch sim', | |
background: 'blue', | |
width: 1500, | |
height: 1300 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text('AnimatedContainer Demo'), | |
), | |
body: Center(child: Highlight(child: Text('123123123122312312'))), | |
))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# global method defined in Object | |
def pp1 | |
'pp1!' | |
end | |
pp1 # => "pp1!" | |
Object.instance_methods.include?(:pp1) # => true | |
class PP1 | |
def my_pp1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'prime' | |
require 'minitest/autorun' | |
class Anagram | |
LETTER_MAP = ('a'..'z').zip(Prime.each).to_h | |
def self.anagram?(word_1, word_2) | |
word_hash(word_1) == word_hash(word_2) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *.png; do mv -n "$f" "$(TZ=UTC+6 date -r "$f" +"%Y%m%d_%H%M").png"; done | |
montage -label %f *.png -tile 5x1 -geometry +0+0 -pointsize 50 out.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mini_exiftool' | |
def correct_date_time(wrong_date_time, offset) | |
c = wrong_date_time + offset | |
# Removes timezone | |
Time.new(c.year, c.month, c.day, c.hour, c.min, c.sec) | |
end | |
def apply_offset_to_photo(path, offset) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" some string ".strip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def knock_the_door | |
`afplay /System/Library/Sounds/Pop.aiff` | |
end | |
def call_penny | |
`say "penny" --rate 300` | |
sleep 0.2 | |
3.times { knock_the_door } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_synth :fm | |
interval = 0.13 | |
chord1 = [:fs5, :b5, :d6] | |
chord2 = [:gs5, :b5, :d6] | |
chord3 = [:b5, :e6, :g6] | |
chord4 = [:a5, :cs6, :e6] | |
chord5 = [:fs6, :b5, :d6] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for commit in $(git rev-list master --reverse) | |
do | |
git checkout $commit | |
read | |
done |