Skip to content

Instantly share code, notes, and snippets.

View eperedo's full-sized avatar
🎲
remote only

Eduardo Peredo Rivero eperedo

🎲
remote only
View GitHub Profile
@eperedo
eperedo / main.css
Created July 10, 2014 04:58
row animated
.row-item {
-webkit-transition: color 0.6s, background-color 0.3s ease-out 1s;
-moz-transition: color 0.6s, background-color 0.3s ease-out 1s;
-ms-transition: color 0.6s, background-color 0.3s ease-out 1s;
transition: color 0.1s, background-color 0.8s ease-out 1s;
}
.row-item.ng-enter {
background-color: #FFF1CC;
-webkit-animation: bounceInRight 1s;
@eperedo
eperedo / validation.js
Created August 24, 2012 02:12
jQuery Validation 1.9 for twitter bootstrap 2.1
jQuery.validator.setDefaults({
validClass: "success",
errorElement: "span",
errorPlacement: function(error, element){
$(error).addClass('help-block').insertAfter(element);
},
highlight: function(element, errorClass, validClass) {
$(element).parents('div.control-group').addClass(errorClass).removeClass(validClass);
},
unhighlight: function(element, errorClass, validClass) {
@eperedo
eperedo / gulpfile.js
Created October 15, 2015 20:50
Browser sync with gulp
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
// Static server
gulp.task('default', ['browser-sync']);
gulp.task('browser-sync', function() {
browserSync.init({
server: {
@eperedo
eperedo / age.js
Created October 17, 2015 18:03
Age
angular
.module('common')
.filter('age', ageFilter);
function ageFilter () {
return function (input, params) {
if (input) {
@eperedo
eperedo / sublime-settings
Created October 24, 2015 13:01
Sublime Text 3 Config
{
"caret_extra_bottom": 0,
"caret_extra_top": 0,
"caret_extra_width": 1,
"color_scheme": "Packages/Seti_UI/Scheme/Seti.tmTheme",
"default_line_ending": "unix",
"folder_exclude_patterns":
[
".idea",
"node_modules",
@eperedo
eperedo / web.config
Created November 26, 2015 20:32
web config for angular apps
<?xml version="1.0"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseExpires"
httpExpires="Tue, 19 Jan 2038 03:14:07 GMT" />
</staticContent>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
@eperedo
eperedo / angular-analytics.js
Created December 27, 2012 02:05
Integrating google analytics with angularjs
//Put this code in the main controller
$scope.$on('$viewContentLoaded', function(event) {
$window._gaq.push(['_trackPageview', $location.path()]);
});
@eperedo
eperedo / DbConfig.cs
Created May 24, 2013 02:30
Example Servicestack OrmLite Blob Text Objects
public class DbConfig
{
public readonly string ConnectionString = ConfigurationManager.ConnectionStrings["TestDb"].ConnectionString;
public readonly OrmLiteConnectionFactory DbFactory;
public DbConfig()
{
DbFactory = new OrmLiteConnectionFactory(ConnectionString, PostgreSqlDialect.Provider);
}
@eperedo
eperedo / app.js
Created June 5, 2013 20:50
AngularJs Directive for ladda buttons - https://github.com/hakimel/Ladda
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope, $timeout) {
$scope.save = function(){
$scope.loading = true;
$timeout(function(){
$scope.loading = false;
}, 3000);
};
@eperedo
eperedo / guid.js
Created June 6, 2013 03:18
Generate a guid in javascript
var generateGuid = function(){
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0,v=c=='x' ? r : r & 0x3 | 0x8;
return v.toString(16);
});
}
console.log(generateGuid());