Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
| STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
| ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint" | |
| if [[ "$STAGED_FILES" = "" ]]; then | |
| exit 0 | |
| fi | |
| PASS=true |
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 wizard = { | |
| schoolName: 'Hogwarts', | |
| headMaster: 'Professor Dumbeldore ', | |
| getWizardName: function(firstname, lastname) { | |
| var fullname = firstname + ' ' + lastname; | |
| return fullname; | |
| }, | |
| getSchoolNameAndHeadMaster: function(){ | |
| return this.headMaster + " will be your headMaster at "+ this.schoolName | |
| } |
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/bash | |
| ## | |
| ## Creates explicit dirs on the bucket | |
| ## | |
| function print_help() { | |
| echo "Usage:" $(basename $0) bucket_mounted_dir | |
| exit 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
| $scope.registerWithFacebook = function() { | |
| FB.getLoginStatus(function(response) { | |
| if (response.status === 'connected') { | |
| console.log("Here") | |
| // Logged into your app and Facebook. | |
| $scope.testAPI(); | |
| } else { | |
| // The person is not logged into your app or we are unable to tell. | |
| document.getElementById('status').innerHTML = 'Please log ' + | |
| 'into this app.'; |
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 scipy.spatial import distance | |
| def euc(a,b): | |
| return distance.euclidean(a,b) | |
| class BareBonesKNN(): | |
| def fit(self, x_train, y_train): | |
| self.x_train = x_train | |
| self.y_train = y_train | |
| pass |
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 numpy as np | |
| from sklearn.datasets import load_iris | |
| from sklearn import tree | |
| iris = load_iris() | |
| test_idx = [0, 50, 100] | |
| #training data | |
| train_target = np.delete(iris.target, test_idx) |
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 sklearn.datasets import load_iris | |
| iris = load_iris() | |
| print (iris.feature_names) | |
| print (iris.target_names) | |
| print (iris.data[0]) | |
| print (iris.target[0]) | |
| for i in range(len(iris.target)): | |
| print ("Example %d: label %s, features %s" % (i, iris.target[i],iris.data[i])) |
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 sklearn import tree | |
| features = [[140, "smooth"], [130, "smooth"], [150, "bumpy"], [170, "bumpy"]] | |
| labels = ["apple", "apple", "orange", "orange"] | |
| clf = tree.DecisionTreeClassifier() | |
| clf = clf.fit(features, labels) |
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 sklearn import tree | |
| #import sklearn | |
| # features = [[140, "smooth"], [130, "smooth"], [150, "bumpy"], [170, "bumpy"]] | |
| # labels = ["apple", "apple", "orange", "orange"] | |
| features = [[140, "1"], [130, "1"], [150, "0"], [170, "0"]] | |
| labels = ["0", "0", "1", "1"] | |
| clf = tree.DecisionTreeClassifier() | |
| clf = clf.fit(features, labels) |
NewerOlder