This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const element = <h1>Hello World</h1>; | |
debugger; | |
ReactDOM.render( | |
element, | |
document.getElementById('fitment-widget-div') | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##GeoViz | |
(Arun Ganesh)[https://en.wikipedia.org/wiki/User:Planemad] | |
(Sajjad Anwar)[https://geohacker.in/] | |
##OpenData | |
(Thejesh GN)[https://thejeshgn.com/] | |
##DataJournalism | |
(Avinash Celestine)[http://datastories.in] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span>{{group.members_count}} <ng-pluralize count='group.members_count'. | |
when="{'1': 'Member', | |
'other':'Members'}"></span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable_storing_a_function = Proc.new {|arg1,arg2| puts "First Argument : #{arg1}\nSecond Arguemt #{arg2}"} | |
variable_storing_a_function.call(1,2) | |
def an_example_function(variable1,variable2,&block) | |
sum = variable1+variable2 | |
block.call(sum) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html class="no-js"> | |
<head> | |
<title></title> | |
</head> | |
<body ng-app> | |
<h1>Model Binding Example| Hello World</h1> | |
<p>{{helloworld}}</p> | |
<input type='text' ng-model='helloworld'></input> | |
<script src="angular.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Intercepting HTTP calls with AngularJS. | |
angular.module('MyApp', []) | |
.config(function ($provide, $httpProvider) { | |
// Intercept http calls. | |
$provide.factory('MyHttpInterceptor', function ($q) { | |
return { | |
// On request success | |
request: function (config) { | |
// console.log(config); // Contains the data about the request before it is sent. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Works for 1.1.x versions. 1.0.x is similar and can be figured out using code comments | |
myapp.factory('httpRequestInterceptor', function ($cookieStore) { | |
return { | |
request: function (config) { | |
var token = $cookieStore.get("auth"); | |
config.url = URI(config.url).addSearch({'_auth_token':token}).toString(); | |
return config; | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Works for 1.1.x versions. 1.0.x is similar and can be figured out using code comments | |
myapp.factory('myHttpResponseInterceptor',['$q','$location',function($q,$location){ | |
return { | |
response: function(response){ | |
return promise.then( | |
function success(response) { | |
return response; | |
}, | |
function error(response) { | |
if(response.status === 401){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hospital < ActiveRecord::Base | |
lambada :certified { where(:certified=>true).joins(:district) } | |
end | |
Hospital.scoped.certified |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This module does all the encryption and decryption using OpenSSL ruby class | |
module EncryptionEngine | |
#encrypt method as the name suggest encrypts 'data' using 'algorithm' with 'key' | |
def encrypt( data, key, algorithm) | |
#Do not encrypt if data is nil | |
if !data.nil? && !data.empty? | |
cipher = OpenSSL::Cipher::Cipher.new algorithm | |
cipher.encrypt |
NewerOlder