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 i = 0, | |
| j = 8; | |
| checkiandj: while (i < 4) { | |
| console.log("i: " + i); | |
| i += 1; | |
| checkj: while (j > 4) { | |
| console.log("j: "+ j); | |
| j -= 1; |
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 pack = function pack (bytes) { | |
| var str = ""; | |
| for(var i = 0; i < bytes.length; i += 2) { | |
| var char = bytes[i] << 8; | |
| if (bytes[i + 1]) | |
| char |= bytes[i + 1]; | |
| str += String.fromCharCode(char); | |
| } | |
| return str; | |
| }; |
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
| function stringToByteArray(str) { | |
| var b = [], i, unicode; | |
| for(i = 0; i < str.length; i++) { | |
| unicode = str.charCodeAt(i); | |
| // 0x00000000 - 0x0000007f -> 0xxxxxxx | |
| if (unicode <= 0x7f) { | |
| b.push(String.fromCharCode(unicode)); | |
| // 0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx | |
| } else if (unicode <= 0x7ff) { | |
| b.push(String.fromCharCode((unicode >> 6) | 0xc0)); |
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
| // React Class template with inlined documentation from | |
| // http://facebook.github.io/react/docs/component-specs.html | |
| var component = React.createClass({ | |
| /***** Core Methods *****/ | |
| render: function () { | |
| // Returns ReactComponent |
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
| /** | |
| * This are a collection of examples for C 201. | |
| * These combine concepts you may or may not be | |
| * familiar with and are especially useful for | |
| * students new to C. There is a lot of really | |
| * cool stuff you can do in C without any cool | |
| * languages. | |
| * | |
| * This is file in particular is an introduction | |
| * to fun function usage in 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ Clash of Clans Auto Tool for Genymotion (VirtualBox Android VM) | |
| """ | |
| import os | |
| import sys | |
| import virtualbox | |
| import subprocess | |
| import cv2.cv as cv |
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
| <?php | |
| namespace Common\Doctrine; | |
| use Doctrine\DBAL\Logging\SQLLogger; | |
| use Monolog\Logger; | |
| class EchoSQLLogger implements SQLLogger | |
| { |
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 fn = function(arg1, arg2) { | |
| var str = '<p>aap ' + this.noot + ' ' + arg1 + ' ' + arg2 + '</p>'; | |
| document.body.innerHTML += str; | |
| }; | |
| var context = { | |
| 'noot': 'noot' | |
| }; | |
| var args = ['mies', 'wim']; | |
| // Calls a function with a given 'this' value and arguments provided individually. |
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
| function wrapSpan(node, index) { | |
| if(node.nodeName === '#text') { | |
| var text = node.textContent; | |
| var s = document.createElement('span'); | |
| s.textContent = text; | |
| node.parentElement.insertBefore(s, node.parentElement.childNodes[index]); | |
| node.remove(); | |
| } else { |
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
| //To run Q.js examples: | |
| // 1. Open a new browser tab in Chrome and turn on developer toolbar. | |
| // 2. Copy/Paste this gist in the console and hit enter to run all the snippets. | |
| // Based on the inspiration from samples @ https://github.com/kriskowal/q | |
| //////////////////////////////////////////////////////////////////// | |
| //////////////////////////////////////////////////////////////////// |