Enable 32 bit architecture:
sudo dpkg --add-architecture i386
| try { | |
| // If bounds are null then there is no selection. | |
| // But null check fails? So use Try/Catch instead. | |
| if (app.activeDocument.selection.bounds) { | |
| // Check Shift Modifier | |
| SHIFT = ScriptUI.environment.keyboardState.shiftKey; | |
| CTRL = ScriptUI.environment.keyboardState.ctrlKey; | |
| // Fill manually. | |
| if (!(CTRL || SHIFT)) { |
Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++ / OOP or (other) obscuring cruft. View on YouTube
| const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
| const asyncForEach = async (array, callback) => { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array) | |
| } | |
| } | |
| const start = async () => { | |
| await asyncForEach([1, 2, 3], async (num) => { | |
| await waitFor(50) |
| height: 600 | |
| license: mit | |
| acknowledgement: Please add "Nadieh Bremer | Visual Cinnamon" to your credit when re-using this code, thank you! |
| The MIT License (MIT) | |
| Copyright (c) 2015 Justin Perry | |
| 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 without limitation the rights to | |
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
| the Software, and to permit persons to whom the Software is furnished to do so, | |
| subject to the following conditions: |
| // set-up a connection between the client and the server | |
| var socket = io.connect(); | |
| // let's assume that the client page, once rendered, knows what room it wants to join | |
| var room = "abc123"; | |
| socket.on('connect', function() { | |
| // Connected, let's sign-up for to receive messages for this room | |
| socket.emit('room', room); | |
| }); |