Skip to content

Instantly share code, notes, and snippets.

View prashanth-sams's full-sized avatar
🍎
Each day is interesting!!!

Prashanth Sams prashanth-sams

🍎
Each day is interesting!!!
View GitHub Profile
@mjumbewu
mjumbewu / auto_water.py
Last active September 17, 2019 14:55 — forked from benrules2/auto_water.py
import water
if __name__ == "__main__":
water.auto_water()
# Usage:
# docker-compose up --force-recreate
version: '2.1'
services:
#--------------#
zalenium:
image: "dosel/zalenium"
container_name: zalenium
hostname: zalenium
@mahdiyazdani
mahdiyazdani / componentdidmount.jsx
Created September 25, 2018 19:42
componentDidMount
import React from 'react';
import ReactDOM from 'react-dom';
export class Flashy extends React.Component {
componentWillMount() {
alert('AND NOW, FOR THE FIRST TIME EVER... FLASHY!!!!');
}
componentDidMount() {
alert('YOU JUST WITNESSED THE DEBUT OF... FLASHY!!!!!!!');
@mjumbewu
mjumbewu / dump-csv
Created July 24, 2018 19:05
Shell script to dump a CSV file from a database table
#!/bin/sh -e
table=$1
psql -U $DBUSER -h $DBHOST -p $DBPORT $DBNAME -c \
"COPY (SELECT * FROM $table) TO STDOUT WITH CSV HEADER"
@cgoldberg
cgoldberg / update_webdrivers.sh
Created July 16, 2018 18:52
Install geckodriver/chromedriver for Linux (64 bit)
#!/usr/bin/env bash
#
# Install WebDrivers for Linux
# ----------------------------
# * Binary webdrivers are required to drive Firefox and Chrome browsers from Selenium.
# * This script will fetch the 64-bit binaries (geckodriver/chromedriver) for Linux.
set -e
@tonyvu2014
tonyvu2014 / componentDidMount.js
Created June 10, 2018 08:00
componentDidMount
componentDidMount() {
this.props.navigation.setParams({
onTabFocus: this.getFeeds
});
this.getFeeds()
}
@cgoldberg
cgoldberg / check_root.bash
Last active November 25, 2018 07:56
got root?
# add this to the beginning of a bash script to ensure it can only be run with root access.
if [[ $EUID -ne 0 ]]; then
echo "permission denied."
echo "$(basename $0) must be run as root."
exit 1
fi
@ThisIsAreku
ThisIsAreku / .env
Last active October 2, 2019 09:54
.env
# Source this file in your .zshrc BEFORE "source $ZSH/oh-my-zsh.sh"
export TERM="xterm-256color"
# Set your username here
export DEFAULT_USER=
# Digital Ocean Token
export DO_TOKEN=
# Path to Android SDK
@prashanth-sams
prashanth-sams / Linux_cmds.md
Last active March 14, 2019 15:22
Commands and shortcuts

Grep

cat appium.txt | grep "your text"
grep "your text" appium.txt
grep --color "your text" appium.txt
ls | grep "your text"

Tmux (split terminal)

@keithweaver
keithweaver / save-file.py
Last active June 14, 2023 05:13
Save JSON file with Python
import json
def writeToJSONFile(path, fileName, data):
filePathNameWExt = './' + path + '/' + fileName + '.json'
with open(filePathNameWExt, 'w') as fp:
json.dump(data, fp)
# Example
data = {}