Skip to content

Instantly share code, notes, and snippets.

Nayuri Aohime DeaR

Block or report user

Report or block DeaR

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
@DeaR
DeaR / nyaos_sudo.lua
Last active Dec 14, 2015
NYAOSでUACを何とかしてみた
View nyaos_sudo.lua
if nyaos.create_object then
local major, minor, build = nyaos.eval(os.getenv('COMSPEC') .. ' /c ver'):match('(%d+).(%d+).(%d+)')
if tonumber(major) >= 6 then
function nyaos.command.sudo(...)
local t = os.tmpname()
t = os.getenv('TEMP') .. '/' .. table.concat({string.byte(t, 1, t:len())})
nyaos.create_object('Shell.Application'):ShellExecute(nyaos.argv[0], '-e \034' .. table.concat({...}, ' ') .. ' > ' .. t .. ' ; echo \\nyaos_sudo_end\\ >> ' .. t .. '\034', nyaos.eval('pwd'), 'runas', 0)
local e
while e ~= '\\nyaos_sudo_end\\' do
f = io.open(t, 'r')
@DeaR
DeaR / shebang.lua
Last active Dec 14, 2015
shebang for NYAOS 3.x
View shebang.lua
-- Shebang for NYAOS 3.x
--
-- Maintainer: DeaR <nayuri@kuonn.mydns.jp>
-- Last Change: 13-Aug-2013.
-- License: MIT License {{{
-- Copyright (c) 2013 DeaR <nayuri@kuonn.mydns.jp>
-- Copyright (c) 2010 wantora
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
@DeaR
DeaR / reparse_point.patch
Last active Dec 14, 2015
NYAOSの内蔵lsでリパースポイントを展開してみた(適当)
View reparse_point.patch
diff -r c95acae76050 lsf.cpp
--- a/lsf.cpp Sun Feb 24 15:47:59 2013 +0900
+++ b/lsf.cpp Tue Feb 26 19:34:27 2013 +0900
@@ -10,6 +10,8 @@
# include "ntcons.h"
# include <windows.h>
# include <wincon.h>
+# include <locale.h>
+# include <ddk/ntifs.h>
#endif
@DeaR
DeaR / Shaberu.lisp
Created Feb 6, 2013
このxyzzy…しゃべるぞ!
View Shaberu.lisp
; Shaberu.l
; 元ネタ: http://blog.supermomonga.com/articles/vim/shaberu-vim.html
; 棒読みちゃんを起動しておいてください
; http://chi.usamimi.info/Program/Application/BouyomiChan/
(defconstant *shaberu-addr* "127.0.0.1")
(defconstant *shaberu-port* 50001)
(defun shaberu-say (str)
(with-open-stream (stream (connect *shaberu-addr* *shaberu-port*))
@DeaR
DeaR / unix_env_expand.lua
Last active Dec 11, 2015
Force expand of Unix style environment variable for NYAOS 3.x
View unix_env_expand.lua
-- Force expand of Unix style environment variable for NYAOS 3.x
--
-- Maintainer: DeaR <nayuri@kuonn.mydns.jp>
-- Last Change: 14-Aug-2013.
-- License: MIT License {{{
-- Copyright (c) 2013 DeaR <nayuri@kuonn.mydns.jp>
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
@DeaR
DeaR / complete_by.lua
Last active Dec 11, 2015
Complete by command for NYAOS 3.x
View complete_by.lua
-- Complete by command for NYAOS 3.x
--
-- Maintainer: DeaR <nayuri@kuonn.mydns.jp>
-- Last Change: 13-Aug-2013.
-- License: MIT License {{{
-- Copyright (c) 2013 DeaR <nayuri@kuonn.mydns.jp>
-- Copyright (c) 2011 azu_re
-- Copyright (c) 2010 wantora
--
-- Permission is hereby granted, free of charge, to any person obtaining a
@DeaR
DeaR / abbreviations.lua
Last active Dec 11, 2015
Abbreviations for NYAOS 3.x
View abbreviations.lua
-- Abbreviations for NYAOS 3.x
--
-- Maintainer: DeaR <nayuri@kuonn.mydns.jp>
-- Last Change: 13-Aug-2013.
-- License: MIT License {{{
-- Copyright (c) 2013 DeaR <nayuri@kuonn.mydns.jp>
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
@DeaR
DeaR / galias.lua
Last active Dec 11, 2015
Global alias for NYAOS 3.x
View galias.lua
-- Global alias for NYAOS 3.x
--
-- Maintainer: DeaR <nayuri@kuonn.mydns.jp>
-- Last Change: 13-Aug-2013.
-- License: MIT License {{{
-- Copyright (c) 2013 DeaR <nayuri@kuonn.mydns.jp>
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
@DeaR
DeaR / z.lua
Last active Dec 11, 2015
Porting z.sh for NYAOS 3.x
View z.lua
-- Porting z.sh for NYAOS 3.x
--
-- Maintainer: DeaR <nayuri@kuonn.mydns.jp>
-- Last Change: 13-Aug-2013.
-- License: MIT License {{{
-- Copyright (c) 2013 DeaR <nayuri@kuonn.mydns.jp>
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
@DeaR
DeaR / coding.lisp
Created Jun 29, 2012
encodingマジックコメントで-dos等を何とかしてみた #xyzzy
View coding.lisp
(defun find-file-buffer-encoding (arg)
"エンコーディングの自動判定"
(let ((encoding (gethash (substitute-string arg "-\\(dos\\|mac\\|unix\\)$" "" :case-fold t)
*mime-charset-name-hash-table*))
(eol (cond ((string-matchp "-dos$" arg)
*eol-crlf*)
((string-matchp "-mac$" arg)
*eol-cr*)
((string-matchp "-unix$" arg)
*eol-lf*))))
You can’t perform that action at this time.