Skip to content

Instantly share code, notes, and snippets.

@sultanshakir
sultanshakir / gmail_sender_name_xpath_for_chrome_console.js
Created May 4, 2017 09:47
Gmail Sender Name XPath for Chrome console
$x('//*/table[@id=":1jx"]/tbody/tr/td[@class="yX xY "]')
.forEach(
function(i) {
console.log(i.innerText)
}
)
@sultanshakir
sultanshakir / README.md
Created January 17, 2017 02:40 — forked from ngryman/README.md
intellij javascript live templates

intellij javascript live templates

Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.

How to

  • Go to settings.
  • Search for live templates.
  • Under the javascript section you should be able to manage your templates.
@sultanshakir
sultanshakir / scope-watch.htm
Created January 10, 2016 14:22 — forked from bennadel/scope-watch.htm
Understanding How To Use $scope.$watch() With Controller-As In AngularJS
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Understanding How To Use $scope.$watch() With Controller-As In AngularJS
</title>
<link rel="stylesheet" type="text/css" href="./demo.css"></link>
@sultanshakir
sultanshakir / AngularJS Behaviors
Created August 26, 2015 06:41
Showing simple mouseenter and mouseleave event detection using AngularJS
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/css/foundation.min.css" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<meta charset="UTF-8">
<title>AngularJS Behaviors</title>
</head>
@sultanshakir
sultanshakir / changeauth.bash
Created August 15, 2015 07:58
Change author and email of all commits
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@sultanshakir
sultanshakir / pre-commit
Last active August 29, 2015 14:27
Pre-commit database dump
#!/bin/sh
mysqldump -u [mysql user] -p[mysql password] --skip-extended-insert [database] > /path/to/your/repo/[database].sql
cd /path/to/your/repo
git add [database].sql