Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Ashok Bakthavathsalam kgashok

🎯
Focusing
Block or report user

Report or block kgashok

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@evancz
evancz / cron.md
Last active Nov 7, 2019
Cron job to remind myself to stretch
View cron.md

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!

@mrcoles
mrcoles / replace_words.js
Last active Nov 28, 2018
Replace all instances of one word with another in a web page
View replace_words.js
// ### 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');
}
View serialAsyncMap.babel.js
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]();
@JoelQ
JoelQ / RandomToTask.elm
Last active Oct 6, 2019
Turn an Elm random generator into task, allowing it to be chained with other side effects.
View RandomToTask.elm
-- 0.19
randomToTask : Generator a -> Task Never a
randomToTask generator =
Time.now
|> Task.map (Tuple.first << Random.step generator << Random.initialSeed << Time.posixToMillis)
-- 0.18
@kgashok
kgashok / bookmarkletCD.md
Last active Nov 27, 2018
bookmarkletCreation.md
View bookmarkletCD.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 / enterprise-tic-tac-toe-2.fsx
Created Mar 3, 2017 — forked from swlaschin/enterprise-tic-tac-toe-2.fsx
Follow up to the example of implementing "enterprise" tic-tac-toe in a functional way.
View enterprise-tic-tac-toe-2.fsx
(*
enterprise-tic-tac-toe-2.fsx
Follow up to the example of implementing "enterprise" tic-tac-toe in a functional way.
* Added true capability based security.
Related blog post: http://fsharpforfunandprofit.com/posts/enterprise-tic-tac-toe-2/
*)
@kgashok
kgashok / info_sec python modules
Created Oct 31, 2016 — forked from sh1nu11bi/info_sec python modules
This a collection of Python modules commonly associated with InfoSec.
View info_sec python modules
Scapy: send, sniff and dissect and forge network packets. Usable interactively or as a library
pypcap, Pcapy and pylibpcap: several different Python bindings for libpcap
libdnet: low-level networking routines, including interface lookup and Ethernet frame transmission
dpkt: fast, simple packet creation/parsing, with definitions for the basic TCP/IP protocols
Impacket: craft and decode network packets. Includes support for higher-level protocols such as NMB and SMB
pynids: libnids wrapper offering sniffing, IP defragmentation, TCP stream reassembly and port scan detection
Dirtbags py-pcap: read pcap files without libpcap
flowgrep: grep through packet payloads using regular expressions
Knock Subdomain Scan, enumerate subdomains on a target domain through a wordlist
Mallory, extensible TCP/UDP man-in-the-middle proxy, supports modifying non-standard protocols on the fly
View so-39628628.elm
import Html exposing (..)
import Html.Events exposing (..)
main : Program Never Model Msg
main =
Html.program
{ init = init
, view = view
, update = update
, subscriptions = \_ -> Sub.none
@kgashok
kgashok / Sample.elm
Last active Apr 30, 2016
Modification of Rundberget's version at (https://gist.github.com/rundis/8b5a0fd09c3eb348dfc2aa7e862436b4) to use String as a stack
View Sample.elm
import SStack as Stack exposing (..)
import Html exposing (..)
reverseString : String -> String
reverseString str =
Stack.reverse str
main : Html.Html
main =
You can’t perform that action at this time.