Skip to content

Instantly share code, notes, and snippets.

View ziishaned's full-sized avatar
:octocat:

Zeeshan Ahmad ziishaned

:octocat:
View GitHub Profile
@ziishaned
ziishaned / cmd-enter-form-submit.js
Last active February 23, 2017 17:17
Submit the form by pressing command + enter button
(function() {
$('.textarea').on('keyup', function(e) {
if (e.which == 13 && ! e.shiftKey) {
// Write AJAX call here
// OR Just submit the form using the below code
$(this).closest('form').submit();
}
});
})();
@ziishaned
ziishaned / Php.sublime-build
Created February 25, 2017 04:12 — forked from abtris/Php.sublime-build
Sublime Text 3 - run php script at F7
{
"cmd": ["php", "$file"],
"selector": "source.php",
"target": "exec",
"variants": [
{ "cmd": ["/usr/local/php5/bin/phpunit", "$file"],
"name": "Run"
}
]
}
@ziishaned
ziishaned / .eslintrc.json
Last active September 29, 2017 10:46
.eslintrc for react
{
"env": {
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true
}
@ziishaned
ziishaned / git.md
Last active February 1, 2018 06:42
Git commands

How to rename a local Git branch?

If you want to rename a branch while pointed to any branch, do:

git branch -m <oldname> <newname>

If you want to rename the current branch, you can do:

@ziishaned
ziishaned / spinner.sh
Created February 5, 2018 14:35 — forked from chriha/spinner.sh
bash spinner
#!/usr/bin/env bash
spinner() {
local cl="\r\033[K"
local pid=$1
local spinnging=true
local delay=0.05
local spinstr="⠏⠛⠹⠼⠶⠧"
printf " "
@ziishaned
ziishaned / mobile-testing.md
Last active February 8, 2018 06:31
Mobile Testing Stuff

Installing app-inspector

npm install app-inspector -g

which app-inspector     # /Users/zeeshan/.nvm/versions/node/v9.3.0/bin/app-inspector
cd /Users/zeeshan/.nvm/versions/node/v9.3.0/bin/app-inspector
npm remove uiautomatorwd
npm install uiautomatorwd@1.0.45
@ziishaned
ziishaned / gist:f3e22934669e50720e190dc86f19736a
Created February 10, 2018 13:55 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@ziishaned
ziishaned / git-tag.sh
Last active February 19, 2018 06:31
Remove a local and remote tag and push a new tag pointing to HEAD
### Remove a local tag
```bash
git tag -d <tag>
```
### Remove a remote tag
```bash
git push --delete origin <tag>
@ziishaned
ziishaned / untracted-files.md
Created March 5, 2018 06:18
Remove untracted files git
git clean -fd
@ziishaned
ziishaned / appium-driver-codeception.md
Last active March 6, 2018 11:46
Appium Driver Codeception

Steps to follow for generating routes

  1. Open the routes file.
  2. Copy the METHOD_MAP object
  3. Open chrome dev tools and paste the object inside console tab and hit enter
  4. Now run the following command
    console.log(JSON.stringify(METHOD_MAP))
  5. Now copy the output and paste it in AppiumCommandRoute.json