View macOS_virtualbox.sh
#!/bin/bash
# This will require about 30GB of space, still in experimental phase right now
sudo gem install iesd
cd /Applications # Or wherever you hve the "Install 10.12 Developer Preview.app" available
iesd -i Install\ 10.12\ Developer\ Preview.app -o macos.dmg -t BaseSystem
hdiutil convert macos.dmg -format UDSP -o macos.sparseimage
# You can cloase any popup finder windows
hdiutil mount Install\ 10.12\ Developer\ Preview.app/Contents/SharedSupport/InstallESD.dmg
View js-best-practices.md

JavaScript Best Practices

Code conventions

Closing/opening brackets

Although this isn't a problem in other languages, because of semicolon insertion, there could be problems if you don't place the bracket on the opening line:

// no:
function()
{
View tampermonkey.partyparrot.js
// ==UserScript==
// @name party parrot - PARTY OR DIE
// @namespace https://github.com/jmhobbs/cultofthepartyparrot.com
// @version 0.1
// @description There's no parrot like party parrot!
// @author cuidas
// @match http://*/*
// @match https://*/*
// @grant none
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
View controllers.application.js
import Ember from 'ember';
const { computed } = Ember;
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
bigNumberTest: computed(function() {
const a = (new BigNumber(2043150)).dividedBy(Math.pow(100, 2));
return a;
View wasm.md

Calling alert from WebAssembly (WASM)

This very simple and minimal tutorial documents in a few easy steps how to play with WebAssembly (WASM) and get first results within minutes.

While the code below is mostly useless, it will show, how to call the alert function from within a WASM file and thus demonstrate how to import and export DOM objects.

Of course, this exercise has no real use. It is just meant to show, that getting started with WASM isn't hard. And there is no need for a complex build-chain, tons of tools or a dedicated VMs. Just use a browser, one online tool and that's it.

And Now?

View ATS Disable
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
View scriptlet.md

The Scriptless Scriptlet

Or how to execute JavaScript from CSS in MSIE11 without using Scripts

Stop! This text is only interesting for you if you...

  • Like popping alerts in weird situations
  • Miss CSS expressions as much as we do
  • Have an unhealthy obsession for markup porn

Introduction

View perfectelementary.bash
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
View gist:1262561
function declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
use:
declOfNum(count, ['найдена', 'найдено', 'найдены']);