Skip to content

Instantly share code, notes, and snippets.

View Trshant's full-sized avatar
🤠
docker/kubernetes/

Trshant Trshant

🤠
docker/kubernetes/
View GitHub Profile
<?php
foreach($_POST['outcome'] as $okey=>$oval){
$rs = mysql_query("INSERT INTO form_quest_outcome_fqo (qid_fqo, idotc_fqo) VALUES ('{$q_id}','{$oval}')", $mx_shop);
$idfqo = mysql_insert_id();
foreach($_POST['outcome_inctype'][$oval] as $ikey=>$ival){
mysql_query("INSERT INTO form_quest_outcomeit_fqi (idfqo_fqi, qid_fqi, idit_fqi) VALUES ('{$idfqo}','{$q_id}','{$ival}')", $mx_shop);
}
}
?>
@Trshant
Trshant / dynamic_naive.js
Created January 25, 2019 04:20
I have been trying to get some kind of intiution in these kind of [problems](https://medium.com/@codingfreak/top-50-dynamic-programming-practice-problems-4208fed71aa3), while i can get the naive solutions done on my own, i cannot think up the solutions easily to the point where i can match the solutions given to these questions in each of those …
function catu(one, two) {
var returnu = [];
two.forEach(element => {
returnu.push(one + element);
returnu.push(element);
});
return returnu;
}
function main_fun(stringu) {
if (stringu.length == 1) {
@Trshant
Trshant / radio.sh
Created January 28, 2019 05:01
this is a sh script where i can play some internet radio
#!/bin/bash
# call this using bash radio.sh Mirchi
# Start list of radio. If the link ends with m3u, then add it as pWhateverYoucallIt. else put it in as cName
pMajesticJukebox="http://uk3.internet-radio.com:8405/live.m3u"
cMirchi='http://peridot.streamguys.com:7150/Mirchi'
cBollywoodHits='http://50.7.77.115:8174/'
cAfsanaIndia='http://174.36.206.197:7019/stream/1/'
#end list of Radio Stations
@Trshant
Trshant / test_node.ts
Created March 8, 2019 01:31
implementation of a prefix tree
var mother_node = new node(null, null);
var string_to_store = "rupsa";
var previous_node = mother_node;
var stored_nodes = [];
string_to_store.split('').forEach(function (element, index) {
var newNode = new node(element, previous_node);
stored_nodes.push(newNode);
previous_node = newNode;
})
console.log(stored_nodes);
@Trshant
Trshant / test_node.ts
Created March 8, 2019 01:32
implementation of a prefix tree
var mother_node = new node(null, null);
var string_to_store = "rupsa";
var previous_node = mother_node;
var stored_nodes = [];
string_to_store.split('').forEach(function (element, index) {
var newNode = new node(element, previous_node);
stored_nodes.push(newNode);
previous_node = newNode;
})
console.log(stored_nodes);
@Trshant
Trshant / Dockerfile
Created April 24, 2019 16:19
docker setup for LAMP
FROM php:7.3-apache
LABEL maintainer="[email protected]"
# Install PHP extensions and PECL modules.
RUN buildDeps=" \
default-libmysqlclient-dev \
libbz2-dev \
libmemcached-dev \
libsasl2-dev \
" \
@Trshant
Trshant / wa_benchmarking.html
Created May 19, 2019 12:07
WA benchmarking
<html>
<head>
<script>
let squarer;
function loadWebAssembly(fileName) {
return fetch(fileName)
.then(response => response.arrayBuffer())
.then(bits => WebAssembly.compile(bits))
@Trshant
Trshant / tmux-cheatsheet.markdown
Created August 21, 2019 10:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Trshant
Trshant / Dockerfile
Last active October 4, 2019 06:54
React Scaffolding files
FROM node:12.10.0-alpine
RUN npm install -g create-react-app \
create-react-native-app \
react-native-cli
RUN mkdir /code
WORKDIR /code
ADD . /code

Bare Basics

  1. https://developer.mozilla.org/en-US/docs/Learn/HTML : read this to re familiarize yourself with the basics of HTML and CSS. The examples are editable, so use that to your advantage.

Setting up a Dev Environment

  1. You will need to build a small webserver. But before that decide if you want to work on just JS or Python. The need for both is there so the decision is up to you. Once you decide, get a webserver up and working. This is just to get started on ediitng your page on your computer. Also, Going forward, we can get all these things up on Heroku ( free hosting ) for your portfolio.
  2. You now need to install a code editor ( Sublime Text or Visual Studio Code ) and start learning GIT. http://tom.preston-werner.com/2009/05/19/the-git-parable.html Read that to understand what GIT does, Then create a s