Skip to content

Instantly share code, notes, and snippets.

View anu1097's full-sized avatar

Anuraag Gupta anu1097

  • India
View GitHub Profile
@anu1097
anu1097 / blackjack.js
Last active April 22, 2021 18:17
BlackJack Problem
function BlackjackHighest(strArr) {
cardValues = {
"two": {"value": 2, "order": 2},
"three": {"value": 3, "order": 3},
"four": {"value": 4, "order": 4},
"five": {"value": 5, "order": 5},
"six": {"value": 6, "order": 6},
"seven": {"value": 7, "order": 7},
"eight": {"value": 8, "order": 8},
"nine": {"value": 9, "order": 9},
@anu1097
anu1097 / tic_tac_toe.js
Last active July 24, 2020 11:47
Tic Tac Toe Node.Js Terminal Game
#!/usr/bin/env node
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
// usage represents the help guide
function usage() {
const usageText = `
Tic Tac Toe application
var createIsPristine = function createIsPristine(_ref) {
var deepEqual = _ref.deepEqual,
empty = _ref.empty,
getIn = _ref.getIn;
return function (form, getFormState) {
return function (state) {
for (var _len = arguments.length, fields = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
fields[_key - 1] = arguments[_key];
}
var createIsPristine = function createIsPristine(_ref) {
var deepEqual = _ref.deepEqual,
empty = _ref.empty,
getIn = _ref.getIn;
return function (form, getFormState) {
return function (state) {
var nonNullGetFormState = getFormState || function (state) {
return getIn(state, 'form');
};
var formState = nonNullGetFormState(state);
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
import createIsPristine from './isPristine';
var createIsDirty = function createIsDirty(structure) {
return function (form, getFormState) {
var isPristine = createIsPristine(structure)(form, getFormState);
return function (state) {
for (var _len = arguments.length, fields = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
import createIsPristine from './isPristine';
var createIsDirty = function createIsDirty(structure) {
return function (form, getFormState) {
var isPristine = createIsPristine(structure)(form, getFormState);
return function (state) {
return !isPristine(state);
};
};
#!/bin/bash
# rm /home/hackerman/TecMul/TM/*.txt #Cambiar ruta por la que contenga los txt #Change route containing the txt
cd ~/p2psp-console/bin/ #Cambiar ruta por la que tenga el p2psp-console #Change path for the p2psp-console
#clear
#echo -e "\n\nKilling All VLC\n\n"
#killall Vlc
while getopts "a:" opt; do
#!/bin/bash
#rm /home/hackerman/TecMul/TM/*.txt #Cambiar ruta por la que contenga los txt
#cd /home/hackerman/p2psp-console/bin/ #Cambiar ruta por la que tenga el p2psp-console
cd ~/p2psp-console/bin
while getopts "a:" opt; do
case ${opt} in
a)
NUM_PEERS="${OPTARG}"
./Orig2.sh -a 1
11608
VLC media player 2.2.4 Weatherwax (revision 2.2.3-37-g888b7e89)
VLC media player 2.2.4 Weatherwax (revision 2.2.3-37-g888b7e89)
[0000563c3b3ca758] dummy interface: using the dummy interface module...
[00007f05b04c8d18] mux_ogg mux: Open
[000055690eb2b148] core libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007fdd5c000e28] http access error: error: HTTP/1.0 404 Client error
[00007fdd5c000e28] http access error: failed to read answer
[00007fdd5c000e28] access_mms access error: cannot connect to localhost:9999
./Orig.sh -a 1
53400
VLC media player 2.2.4 Weatherwax (revision 2.2.3-37-g888b7e89)
[0000557902d0c148] core libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007fbc94000e28] core access error: read error: Connection reset by peer
[00007fbc94000e28] http access error: failed to read answer
[00007fbc94000e28] core access error: connection failed: Connection refused
[00007fbc94000e28] http access error: cannot connect to localhost:9999
[00007fbc94000e28] access_mms access error: cannot connect to localhost:9999
QObject::~QObject: Timers cannot be stopped from another thread