Codespaces is a product from GitHub that allows users to use a hosted version of VS Code to edit their GitHub repositories online.

- GitHub Staff
- @[email protected]
- in/aeisenberg
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 function implements the Sieve of Eratosthenes. | |
* https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
* | |
* @param {number} lastNumber The upper bound of the number to check | |
* @return {number[]} An array of prime numbers less than lastNumber | |
*/ | |
function sieve(lastNumber = 1000) { | |
// Create an array and fill it with true | |
// Important! the array's length is one more than lastNumber so that |
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
#! /bin/sh -e | |
server=gerrit.example.com # change to your own server | |
username=$1 | |
project=$2 | |
url=ssh://${username}@${server}:29418/${project} | |
git clone ${url} | |
cd ${project} | |
git config gerrit.createchangeid true | |
git config remote.origin.url ${url} | |
git config remote.origin.push HEAD:refs/for/master |
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
import java.util.Collection; | |
public class Ambiguity { | |
public void foo(CriteriaBuilder builder) { | |
// change Object -> Number (or any other type) and it compiles | |
Expression<Object> objectExpression = null; | |
Expression<Collection<Object>> collectionOfObjectExpression = null; | |
builder.isNotMember(objectExpression, collectionOfObjectExpression); | |
} |
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
tell application "Evernote" | |
set _Notebooks to every notebook | |
repeat with _NoteBook in _Notebooks | |
set _NoteBookName to name of _NoteBook | |
set _Notes to every note of _NoteBook | |
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
// argv: size, dims | |
'strict mode'; | |
var size = process.argv[2]; | |
var dims = process.argv[3]; | |
var grid = initializeGrid(size, dims); | |
setValueAt(createArray(dims, 0), grid, 1); | |
var initialLoc = createArray(dims, size-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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript"> | |
angular.module('watchingApp', []) | |
.controller('watchedController', function($scope) { | |
$scope.value = 9; | |
}) | |
.directive('watching', function() { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.js" | |
type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript"> | |
angular.module('watchingApp', []) | |
.controller('watchedController', function($scope) { | |
$scope.value = 9; | |
}) |
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
<!DOCTYPE html> | |
<html ng-app="parent"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.js" | |
type="text/javascript"></script> | |
<script type="text/javascript"> | |
angular.module('sub1', []) | |
.run(function(sub2Value) { | |
console.log(sub2Value); |
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
public class ClosureWriter { | |
protected interface UseExistingReference {} | |
public void writeClosure(ClosureExpression expression) { | |
// create some byte-code | |
// ... | |
expression.setNodeMetaData(ClosureWriter.UseExistingReference.class,Boolean.TRUE); | |
// do some more byte-code writing |
NewerOlder