Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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 / 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 / combinemultiplecsv.sh
Created June 5, 2017 06:24
Combine multiple .csv files
# run from within directory tha contains CSV files you want to combine
cat *.csv > combined.csv
@sultanshakir
sultanshakir / iterm2-solarized.md
Created September 5, 2017 15:13 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@sultanshakir
sultanshakir / getcontentserviceurl.prg
Created September 18, 2017 04:14
CCL to get Content Service URL for custom components for static content refresh
select *
from dm_info d
where d.info_domain = "INS"
and d.info_name = "CONTENT_SERVICE_URL"
with time = 10
' If you want to be sure that the static content has refreshed properly - take out the "/manager" part of the URL from the content management page, and replace it with:'
/custom_mpage_content/custom-components/js/custom-components.js
' That should let you download the JS file from the web server, rather than the code warehouse, so you can make sure that it has actually refreshed.
You can also refresh the static content by running the CCL program manually: '
mp_refresh_static_content "MINE", "custom_mpage_content"