// jQuery
$(document).ready(function() {
// code
})
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:8 | |
| # Install dependencies | |
| RUN apt-get update &&\ | |
| apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \ | |
| libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \ | |
| libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \ | |
| libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ | |
| ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget \ | |
| xvfb x11vnc x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bot.on('trigger', function (message) { | |
| // handle message from trigger function | |
| var queuedMessage = message.value; | |
| var botAdapter = botPatch.patch(bot); | |
| var callBackFn = function (dat, session) { | |
| session.userData.foo = {}; | |
| }; | |
| botAdapter.loadSession(queuedMessage.address, {}, callBackFn); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<TestObject> convertedResult = new List<TestObject>(resultByteArray.Length/sizeOfObject); | |
| for (index = 0; index < resultByteArray.Length; ) | |
| { | |
| var testObject = new TestObject(); | |
| testObject.A = BitConverter.ToInt32(resultByteArray, index); | |
| index += 4; | |
| testObject.B = BitConverter.ToUInt32(resultByteArray, index); | |
| index += 4; | |
| testObject.C = resultByteArray[index++]; | |
| testObject.D = BitConverter.ToUInt16(resultByteArray, index); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<TestObject> listOfTestObjects = new List<TestObject>{ new TestObject { A = 12356, B = 23455, C = 45, D = 4500} }; | |
| int index = 0, sizeOfObject = 11; | |
| byte[] resultByteArray = new byte[sizeOfObject * listOfTestObjects.Count]; | |
| foreach(var testObject in listOfTestObjects) | |
| { | |
| Buffer.BlockCopy(BitConverter.GetBytes(testObject.A), 0, resultByteArray, index, 4); | |
| index += 4; | |
| Buffer.BlockCopy(BitConverter.GetBytes(testObject.B), 0, resultByteArray, index, 4); | |
| index += 4; | |
| Buffer.SetByte(resultByteArray, index++, testObject.C); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.getElementsByClassName("item_type_normal").length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var urls = []; | |
| [].forEach.call(document.querySelectorAll('.layout_3col_center .pagedlist_item'), function (el) { | |
| urls.push("https://www.quora.com/" + el.querySelectorAll(".question_link")[0].getAttribute("href")); | |
| }); | |
| console.log(JSON.stringify(urls)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Primitive Type Comparison | |
| var a = 1; | |
| var b = 1; | |
| var c = a; | |
| console.log(a == b); //true | |
| console.log(a === b); //true | |
| console.log(a == c); //true | |
| console.log(a === c); //true |