Skip to content

Instantly share code, notes, and snippets.

View diegodelfin7's full-sized avatar

Bryan Delfin diegodelfin7

  • Lima, Perú
View GitHub Profile
@diegodelfin7
diegodelfin7 / modulepattern.md
Created April 11, 2018 17:34 — forked from Foxandxss/modulepattern.md
Module pattern Javascript (Español)

Scopes en Javascript:

Si haces algo en plan:

var a = 10;

function foo() {
  console.log(a);
}
@diegodelfin7
diegodelfin7 / controller.js
Created January 3, 2018 19:33 — forked from jakebern/controller.js
Jasmine Testing - Injecting and testing for state change
.controller('A', function($scope, $state){
$scope.functionA = function(ID){
$state.go('next-state', {number: ID});
};
})
@diegodelfin7
diegodelfin7 / bootstrap-menu-triangles.css
Created February 22, 2017 05:27
Triangles for bootstrap dropdown menus
.dropdown-menu::before {
border-bottom: 9px solid rgba(0, 0, 0, 0.2);
border-left: 9px solid rgba(0, 0, 0, 0);
border-right: 9px solid rgba(0, 0, 0, 0);
content: "";
display: inline-block;
left: 86px;
position: absolute;
top: -8px;
}
<!DOCTYPE html>
<html>
<head>
<title>TypeScript Introduccion</title>
</head>
<body>
<script src='greeter.js'></script>
</body>
</html>
var Student = (function () {
function Student(firstName, middleInitial, lastName) {
this.firstName = firstName;
this.middleInitial = middleInitial;
this.lastName = lastName;
this.fullName = firstName + " " + middleInitial + " " + lastName;
}
return Student;
}());
function greeter(person) {
class Student {
fullName : string;
constructor(public firstName, public middleInitial, public lastName) {
this.fullName = firstName + " " + middleInitial + " " + lastName;
}
}
interface Person {
firstName : string;
lastName : string;
@diegodelfin7
diegodelfin7 / angular.cshtml
Created October 19, 2016 22:48 — forked from menacestudio/angular.cshtml
Quick AngularJS CRUD
@section scripts {
<script>
var app = window.app = {};
app.userTypes = @Html.Raw(Json.Encode(Model.GetUserTypes()));
</script>
<script src="~/Scripts/angular.min.js"></script>
<script src="~/Scripts/angular-resource.min.js"></script>
<script src="~/Scripts/underscore.min.js"></script>
<script src="~/Scripts/angular/main.js"></script>
@diegodelfin7
diegodelfin7 / bearerHttpInterceptor
Created July 24, 2016 18:08 — forked from antoniocapelo/bearerHttpInterceptor
AngularJS HTTP Interceptor for Bearer Token Auth Requests
app.factory('BearerAuthInterceptor', function ($window, $q) {
return {
request: function(config) {
config.headers = config.headers || {};
if ($window.localStorage.getItem('token')) {
// may also use sessionStorage
config.headers.Authorization = 'Bearer ' + $window.localStorage.getItem('token');
}
return config || $q.when(config);
},

Step by step to install Scala + Play Framework in Ubuntu 14.04 with Activator.

Install Scala

sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.6.deb
sudo dpkg -i scala-2.11.6.deb
sudo apt-get update
sudo apt-get install scala