Skip to content

Instantly share code, notes, and snippets.

View kgashok's full-sized avatar
🎯
Focusing

Ashok Bakthavathsalam kgashok

🎯
Focusing
View GitHub Profile
@kgashok
kgashok / importantTopics-kgashok.md
Created April 6, 2018 15:11
importantTopics-kgashok
<title>importantTopics-kgashok</title>
@kgashok
kgashok / cron.md
Created December 17, 2017 02:01 — forked from evancz/cron.md
Cron job to remind myself to stretch

Type crontab -l to see your cron jobs. Type crontab -e to edit them. You have to use Vim apparently.

Add a line like this:

0,30	*	*	*	*	/Users/YOURNAME/Documents/scripts/stretch.sh

That is on every 0th and 30th minute of the hour. Make sure all the separators in there are tabs!

@kgashok
kgashok / replace_words.js
Created December 14, 2017 18:17 — forked from mrcoles/replace_words.js
Replaces words in a web page
// ### Replace words in document
//
// Update all instances of `fromWord` to `toWord` within the text
// in the current document.
//
function replaceWordsInDocument(fromWord, toWord) {
if (/\s/.test(fromWord)) {
throw new Error('You must enter a single word without whitespace');
}
// Ernest Hemingway
function fibonacci(size) {
var first = 0, second = 1, next, count = 2, result = [first, second];
if(size < 2)
return "the request was made but it was not good"
while(count++ < size) {
@kgashok
kgashok / reverseListBetweenMandN.md
Last active October 3, 2017 12:56 — forked from superlayone/reverseListBetweenMandN.md
Reverse a linked list from position m to n in-place and in one-pass.

##Leetcode-Reverse Linked List II##

Reverse a linked list from position m to n. Do it in-place and in one-pass.

For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4,

return 1->4->3->2->5->NULL.

Note: Given m, n satisfy the following condition:

var serialAsyncMap = function () {
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(collection, fn) {
var result, _iterator, _isArray, _i, _ref2, item;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
result = [];
_iterator = collection, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();
@kgashok
kgashok / bookmarkletCD.md
Last active November 27, 2018 05:24
bookmarkletCreation.md

Bookmarklet for Custom Starting Points

  1. Create a duplicate bookmark by copy-pasteing an existing bookmark on your bookmark bar. The newly created bookmark will serve as a placeholder for putting in some bookmarklet JavaScript code.
    • Edit the bookmark and change the Name to CustomCD or whatever you might prefer to call it. You may choose to skip this step and edit the name when you update the URL in step 4 below.
  2. Select the below Javascript code by starting your cursor from before the javacript keyword all the way to the () at the very end. Copy the selection into your Clipboard by using Ctrl-C.
  3. Right-click on the CustomCD bookmark from Step 2 and choose "Edit".
  4. Paste the JS code (use Ctrl-V) directly into the dialog box referred to as "URL"
  5. If you haven't change the "Name" of the bookmark, edit that before you Save the bookmark.
@kgashok
kgashok / cdPython.md
Last active August 25, 2017 15:20
customStarts.md

URL Shortener for Python Practice on CyberDojo

tl;dr - In ~20 seconds, use http://j.mp/cdPython to launch a CyberDojo programming environment for deliberate team practice!

Also click the following link if you want a "Bookmarklet for Custom Start Points".

5 steps to setup a team dojo session to practice the FizzBuzz exercise in Python using the py.test framework

In 4.5 easy steps, you can launch your own CyberDojo session within ~20 seconds. Here's how:

@kgashok
kgashok / dollarToRupee.cpp
Created May 31, 2017 20:14
dollarToRupee created by kgashok - https://repl.it/I0Qr/0
#include <iostream>
using namespace std;
class RupeeAmount {
float valueInRupees;
public:
RupeeAmount() { valueInRupees = 0; }
RupeeAmount(float val) { valueInRupees = val; }
################################################################################################################################
# Author: Naveenkumar Ramaraju #
# Hidden Decision Trees #
# Based on article: http://www.datasciencecentral.com/profiles/blogs/state-of-the-art-machine-learning-automation-with-hdt #
# Date: Feb-18-2017 #
# File version - 1 #
# pyhton - version: 3.6 #
#########################################################################################################################