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
using Microsoft.Phone.Controls; | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.IO.IsolatedStorage; | |
using System.Linq; | |
using System.Text; | |
using System.Windows; |
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
### Alias for launching chrome from command line | |
### Add to .bashrc or .bash_profile or .zshrc (if zsh) | |
### ex: chrome twitter.com | |
function chrome(){ | |
open -a 'Google Chrome' 'http://'$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
cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" | |
//where user is username, 1.1.1.1 is your ip-address |
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
//convert "My funny text" to "my-funny-text" | |
function convertToSlug(Text) { | |
return Text.toLowerCase().replace(/ /g,'-').replace(/[^\w-]+/g,''); | |
} |
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
//remove dangerous symbols | |
function safeRegexp(query) { | |
return query.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$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
//use angular services inside browser's console | |
var User = angular.injector(['lbServices']).get('User'); |
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 will generate 8wde for example | |
function genShortUid() { | |
return ('0000' + (Math.random()*Math.pow(36,4) << 0).toString(36)).slice(-4); | |
} |
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 flat(arr, old) { | |
var plain = old || []; | |
arr.reduce(function(prev, curr) { | |
if(curr instanceof Array) { | |
return flat(curr, plain); | |
} else { | |
plain.push(curr); | |
return plain; | |
} |
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
const request = require("request-promise-native"); | |
const brain = require("brain.js"); | |
const net = new brain.NeuralNetwork(); | |
let DATA = []; | |
const dataJson = require('./matches.json') | |
const nsort = (a, b) => a - b | |
function calc(val) { | |
const train_list = dataJson.map(data => { |
OlderNewer