csrutil disable
This file contains 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
// | |
// FontRegistry.h | |
// Tabris | |
// | |
// Created by Jordi Böhme López on 25.07.12. | |
// Copyright (c) 2012 EclipseSource. | |
// All rights reserved. This program and the accompanying materials | |
// are made available under the terms of the Eclipse Public License v1.0 | |
// which accompanies this distribution, and is available at | |
// http://www.eclipse.org/legal/epl-v10.html |
This file contains 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
class Spec: QuickSpec { | |
override func spec() { | |
beforeSuite { | |
print("☕️ before suite") | |
} | |
afterSuite { | |
print("🗑 after suite") | |
} |
This file contains 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
class Node { | |
constructor(value, next) { | |
this.value = value; | |
this.next = next; | |
} | |
} | |
function getRandom(list, k) { | |
const reservoir = new Array(k); |
This file contains 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 dec2bin(dec){ | |
var str = (dec >>> 0).toString(2); | |
return (str.length < 32) ? Array(32 - str.length).fill(0).join('').concat(str) : str; | |
} |
This file contains 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
class Node { | |
constructor(value = "", parent = undefined) { | |
this.value = value; | |
this.parent = parent; | |
this.children = []; | |
if (this.parent != undefined) { | |
this.parent.children.push(this); | |
} | |
} |
This file contains 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
// Print all permutations of a string in JavaScript (ES6) | |
// O(2^n) runtime | |
class StringSubsets { | |
constructor(str) { | |
this.str = str; | |
} | |
print() { | |
const map = new Map(); |
This file contains 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
// NOTE: This is written using ES6 - make sure your JavaScript compiler is ES6 compliant | |
class StringPermutation { | |
constructor(str) { | |
this.originalString = str.slice(); // deep copy string | |
} | |
printAllPermutationsWithDuplicates() { | |
this.permutate( |
This file contains 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
#!/bin/bash | |
#################################### | |
# Setup | |
#################################### | |
tmpfile="/vagrant/.capacitor/runonce" | |
if [ -e ${tmpfile} ]; then | |
echo "Provisioning already completed. Remove ${tmpfile} to run it again." |
This file contains 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
# Gist at: https://gist.github.com/sghiassy/e14593a439a03028b98a | |
##### OSX | |
.DS_Store | |
##### Xcode | |
build/ | |
*.pbxuser | |
!default.pbxuser | |
*.mode1v3 |
NewerOlder