Skip to content

Instantly share code, notes, and snippets.

View vko-online's full-sized avatar
🎥
learning filming

Medet Tleukabiluly vko-online

🎥
learning filming
  • Kazakhstan
View GitHub Profile
@vko-online
vko-online / XHRHelper.cs
Created August 20, 2014 03:06
XHRHelper File for cordova
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;
@vko-online
vko-online / .zshrc
Created June 26, 2015 05:07
Launch chrome from command line
### 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;
}
@vko-online
vko-online / SSH RSA-key
Last active February 2, 2016 06:23
Copy your id_rsa.pub to remove machine so that you don't need to type password everytime
cat ~/.ssh/id_rsa.pub | ssh user@1.1.1.1 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
//where user is username, 1.1.1.1 is your ip-address
@vko-online
vko-online / slug.js
Last active February 2, 2016 06:28
JavaScript slug regexp
//convert "My funny text" to "my-funny-text"
function convertToSlug(Text) {
return Text.toLowerCase().replace(/ /g,'-').replace(/[^\w-]+/g,'');
}
@vko-online
vko-online / safeRegexp.js
Last active February 2, 2016 06:28
JavaScript safe regexp queries when using MongoDB database
//remove dangerous symbols
function safeRegexp(query) {
return query.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
}
@vko-online
vko-online / angular-injector.js
Created February 2, 2016 06:30
Use angular services inside browser's console
//use angular services inside browser's console
var User = angular.injector(['lbServices']).get('User');
@vko-online
vko-online / generate-short-uid.js
Created February 2, 2016 06:33
Generate 4 alpha-numberic symbols, useful for SMS services, DOM id attrs
//this will generate 8wde for example
function genShortUid() {
return ('0000' + (Math.random()*Math.pow(36,4) << 0).toString(36)).slice(-4);
}
@vko-online
vko-online / citrusbyte.js
Last active February 20, 2017 12:45
cv task
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;
}
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 => {