Skip to content

Instantly share code, notes, and snippets.

View saschanaz's full-sized avatar
🏢
Working from office

Kagami Sascha Rosylight saschanaz

🏢
Working from office
View GitHub Profile
@saschanaz
saschanaz / installFirefox.cmd
Last active August 29, 2015 14:02
Install Firefox
set directory=%USERPROFILE%
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe"
if errorlevel 1 (
bitsadmin /transfer "DownloadFirefox" "https://download.mozilla.org/?product=firefox-stub&os=win&lang=ko" "%directory%\firefoxInstaller.exe"
echo Installing Firefox...
start /wait /D "%directory%" firefoxInstaller.exe
del "%directory%\firefoxInstaller.exe"
)
start firefox.exe http://jsfiddle.net/saschanaz/Rxv46/embedded/result/
@saschanaz
saschanaz / dict.md
Last active August 29, 2015 14:04
Design proposal: Dictionary

I suggest a new keyword dict, which permits any access to non-declared properties.

Syntax

// Declaring a dictionary variable
dict var some = new SomeClass();
some.x // Valid, semi-implicit 'any' type because of explicit 'dict' keyword
some.y // Valid
some.anyOtherNonPredefinedProperty // Valid
@saschanaz
saschanaz / callsugar.md
Last active August 29, 2015 14:05
Design proposal: Syntax sugar for function calling

Syntax

"abc"<-Array.prototype.map((c) => c);

var uint8array: Uint8Array;
var array = uint8array<-Array.prototype.map((i) => i);

Compiles to:

@saschanaz
saschanaz / typeoverriding.md
Last active August 29, 2015 14:05
Design proposal: Type overriding

Introducing override keyword for this proposal. The keyword name is changeable.

Syntax

var foo: T;
override foo = u; // u of arbitrary type U
override foo: TT; // TT that implements T

declare bar: T2;
@saschanaz
saschanaz / bound.md
Created September 3, 2014 11:23
Design proposal: Bound function

ES proposal:

bound function foo() {
}

foo(); // invalid, cannot be called directly
bar.addEventListener("some", foo); // can be passed as a normal function
@saschanaz
saschanaz / convert_flac2wav2wmal.ps1
Last active September 29, 2018 06:24
Convert FLAC to WMA Lossless
# Partly from http://kneppscript.wordpress.com/2011/03/25/encoding-wma-files-using-powershell-and-microsoft-expression-encoder/
# Depends on FLAC for Windows from Xiph; Expression Encoder 4 SP1 from Microsoft
if ([Environment]::Is64BitProcess)
{
write-warning 'Launching x86 PowerShell'
&"$env:windir\syswow64\windowspowershell\v1.0\powershell.exe" -executionpolicy remotesigned -noninteractive -noprofile -file $myinvocation.Mycommand.path
exit
}
@saschanaz
saschanaz / atomscroller.js
Created October 8, 2014 16:59
Atom Touch-scroll Enabler
(function () {
// removeListeners From http://stackoverflow.com/a/18650831
function removeListeners(el) {
//only replace the ancestor element
var clone = el.cloneNode(false);
//copy children backwards because of the removal
for (var index = el.childNodes.length - 1; index >= 0; --index)
clone.insertBefore(el.childNodes[index], clone.firstChild);
@saschanaz
saschanaz / webpjs-0.0.2.modified.js
Created December 16, 2014 16:41
webpjs-0.0.2.modified.js
// Copyright 2011 Google Inc. \
// \
// This code is licensed under the same terms as WebM: \
// Software License Agreement: http://www.webmproject.org/license/software/ \
// Additional IP Rights Grant: http://www.webmproject.org/license/additional/ \
// ----------------------------------------------------------------------------- \
// \
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND \
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
@saschanaz
saschanaz / konachan.user.js
Last active August 29, 2015 14:13
Konachan
// ==UserScript==
// @name Konachan
// @namespace sn-konochan-https-imager
// @include https://konachan.com/*
// @version 1.1
// @grant none
// ==/UserScript==
window.snKonachanStatus = "scriptloaded";
document.addEventListener("DOMContentLoaded", () => {
@saschanaz
saschanaz / descroller.user.js
Last active August 29, 2015 14:13
Smartoon Descroller
// ==UserScript==
// @name Smarttoon Descroller
// @namespace sn-smartoon-descroller
// @include http://m.comic.naver.com/webtoon/detail.nhn?*
// @version 1.2.0
// @grant none
// ==/UserScript==
document.addEventListener("DOMContentLoaded", () => {
if (!window.SmarttoonViewer)