Skip to content

Instantly share code, notes, and snippets.

@agentmilindu
agentmilindu / index.html
Created May 30, 2012 05:57
media queries
<link rel="stylesheet" href="global.css" media="all">
<link rel="stylesheet" href="desktop.css" media="all and (min-width: 700px)">
<!--[if (lt IE 9)&(!IEMobile 7)]>
<link rel="stylesheet" href="desktop.css" media="all">
<![endif]-->
<link rel="stylesheet" href="mobile.css" media="all and (max-width: 700px)">
<!--[if IEMobile 7]>
<link rel="stylesheet" href="mobile.css" media="all">
@agentmilindu
agentmilindu / gist:3411402
Last active October 9, 2015 00:28 — forked from jmblog/gist:3222899
Simple HTML encoding/decoding using jQuery
// http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding
function htmlEncode(value){
return $('<div/>').text(value).html();
}
function htmlDecode(value){
return $('<div/>').html(value).text();
}
@agentmilindu
agentmilindu / favicon icon + Tile icon
Created January 30, 2013 03:34
Given the limitations of Chrome, Safari, and IE, this method will give every browser the best favicon experience. IE will ignore the <link rel="icon"> and use the ICO favicon found in the root of the domain as '/favicon.ico'
<link rel="apple-touch-icon" href="path/to/touchicon.png">
<link rel="icon" href="path/to/favicon.png">
<!--[if IE]><link rel="shortcut icon" href="path/to/favicon.ico"><![endif]-->
<!-- or, set /favicon.ico for IE10 win -->
<meta name="msapplication-TileColor" content="#D83434">
<meta name="msapplication-TileImage" content="path/to/tileicon.png">
services.factory('DiskImagesFactory', function ($resource) {
return $resource('api/diskImages/:id', {id: '@_id'}, {
getDiskImages: {
method: 'GET',
url : 'api/project/:id/diskImages',
params : { id: '@_id' },
isArray : true
}
})
});
alert();
@agentmilindu
agentmilindu / Guidelines for SCoRe repos
Last active December 6, 2017 18:20
Guidelines for SCoRe repos
This repos should follow Gitflow workflow and follow are the items you have to check.
- [ ] There is a `master` branch and a `develop` branch.
- [ ] `master` branch is locked for direct commits and,
- [ ] Require pull request reviews before merging is active
- [ ] Require status checks to pass before merging is active
- [ ] Require branches to be up to date before merging
- [ ] Appropriate Status checks are required
- [ ] Enforce all configured restrictions for administrators is active
- [ ] Restrict only maintainers group can push to the master branch
- [ ] `develop` branch is locked for direct commits and,
This repos has a Dockerfile but it does not contain any Label Schema labels. Following are the lables we have to have on our Dockers.
- [ ] `name`
- [ ] `description` Shoud be on user's perspective.
- [ ] `url` Should be SCoRe website
- [ ] `vcs-url` Should point to GitHub repo
- [ ] `vcs-ref`
- [ ] `vendor` Shoudl be "SCoRe Lab"
- [ ] `version`
- [ ] `schema-version`
#!/bin/bash
# Install MySQL on Debian based Linux
mysql_root_password='s57d46857f968t79pho'
bassa_db_name='bassa'
bassa_user_name='bassa'
bassa_user_password='678yU8O7T87ihu7HU9797U'
echo "Installing MySQL on Debian based Linux"
@agentmilindu
agentmilindu / pre-commit
Last active December 23, 2017 07:45 — forked from broofa/pre-commit
Git pre-commit hook that runs `eslint`
#!/bin/bash
cd "$(git rev-parse --show-toplevel)"
ESLINT="node_modules/.bin/eslint"
pwd
if [[ ! -x "$ESLINT" ]]; then
printf "\t\033[41mPlease install ESlint\033[0m (npm install eslint)\n"
exit 1
fi
{ "status" : "OK" }