Skip to content

Instantly share code, notes, and snippets.

View karthickvkumar's full-sized avatar
🎯
Focusing

Karthick Kumar karthickvkumar

🎯
Focusing
View GitHub Profile
@karthickvkumar
karthickvkumar / certificate.cnf
Created April 18, 2023 16:33 — forked from arundhaj/certificate.cnf
Using Angular CLI and self-signed SSL Certificate to serve over HTTPS in localhost
[req]
default_bits = 2048
prompt = no
default_md = sha256
x509_extensions = v3_req
distinguished_name = dn
[dn]
C = IN
ST = India
// Karma configuration
// Generated on Thu Oct 18 2018 18:22:53 GMT+0530 (India Standard Time)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
reporters: ['progress', 'html'],
@karthickvkumar
karthickvkumar / filter.js
Created October 5, 2017 09:53
angular filter
var left_left = $filter('filter')(objects, {
id : "LEGLEFT"
});
@karthickvkumar
karthickvkumar / position.js
Created July 3, 2017 12:01
show object positoin
_transformObject: function(e) {
this.renderAll();
transform.target._renderTransformDetail(transform);
}
fabric.Object = fabric.util.createClass({});
transformDetailOffset: 30,
showTransformDetails: true,
//service
app.service('MyService', function () {
this.sayHello = function () {
console.log('hello');
};
});
//factory
app.factory('MyService', function () {
return {
@karthickvkumar
karthickvkumar / chunk.js
Created June 20, 2017 06:11
Chunk array into equals
Array.prototype.chunk = function ( n ) {
if ( !this.length ) {
return [];
}
return [ this.slice( 0, n ) ].concat( this.slice(n).chunk(n) );
};
@karthickvkumar
karthickvkumar / isolate_scope.html
Last active June 5, 2017 06:35
Angular js isolated scopes
<div ng-controller="MyCtrl">
<h2>Parent Scope</h2>
<input ng-model="foo"> <i>// Update to see how parent scope interacts with component scope</i>
<br><br>
<!-- attribute-foo binds to a DOM attribute which is always
a string. That is why we are wrapping it in curly braces so
that it can be interpolated.
-->
<my-component attribute-foo="{{foo}}" binding-foo="foo"
isolated-expression-foo="updateFoo(newFoo)" >
@karthickvkumar
karthickvkumar / array_difference.js
Last active June 3, 2017 15:09
Array difference
/*Return only difference array*/
[1,2].filter(function(i){
return [3,1].indexOf(i) < 0
})
/*Return concat difference array*/
[1,2].filter(function(i){
return [3,1].indexOf(i) < 0
}).concat([3,1].filter(function(i){
return [1,2].indexOf(i) < 0
@karthickvkumar
karthickvkumar / drag.html
Created May 31, 2017 02:13
Javascript Native Drag
<div id="one">
</div>
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
{{data.time}}
<br/>
<button ng-click="updateTime()">update time - ng-click</button>
<button id="updateTimeButton" >update time</button>
</div>