Skip to content

Instantly share code, notes, and snippets.

View intellix's full-sized avatar

D intellix

View GitHub Profile
@intellix
intellix / SassMeister-input.scss
Created August 26, 2015 13:05
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// .popover
.popover {
padding: 10px;
color: red;
background: green;
margin-bottom: 10px;
@intellix
intellix / SassMeister-input.scss
Created August 26, 2015 13:06
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// .popover
.popover {
padding: 10px;
color: red;
background: green;
margin-bottom: 10px;
@intellix
intellix / form.html
Created February 13, 2014 09:04
One field with validation Bootstrap/Angular
<div class="form-group" ng-class="{'has-error': stepForm.email.$invalid && (stepForm.email.$dirty || stepForm.submitted), 'has-success': !stepForm.email.$invalid, 'has-feedback': (stepForm.email.$invalid && stepForm.email.$dirty) || !stepForm.email.$invalid || stepForm.submitted}">
<div class="col-md-12">
<input type="email" placeholder="{{ 'Email' | translate }}" class="form-control" ng-model="user.email" name="email" required>
<span class="glyphicon form-control-feedback" ng-class="{'glyphicon-ok': !stepForm.email.$invalid, 'glyphicon-remove': stepForm.email.$invalid && (stepForm.email.$dirty || stepForm.submitted)}" ng-show="(stepForm.email.$invalid && stepForm.email.$dirty) || !stepForm.email.$invalid || stepForm.submitted"></span>
<p class="help-block error" ng-show="stepForm.email.$error.required && (stepForm.email.$dirty || stepForm.submitted)">{{ 'This field is required' | translate }}</p>
<p class="help-block error" ng-show="stepForm.email.$error.email && (stepForm.email.$dirty || stepForm.s
'use strict';
angular.module('myApp').service('UserService', function($http, $q, $location) {
var self = {
identity: {
id: 'guest'
},
@intellix
intellix / Gruntfile.js
Created May 30, 2014 12:25
ngtemplates
module.exports = function(grunt) {
grunt.initConfig({
ngtemplates: {
yourModuleName: {
options: {
// This will add a / so make sure you ng-include="/app/blah.tpl.html" etc
prefix: '/'
},
cwd: '<%= yeoman.src %>',
src: 'app/{,**/}*.tpl.html',
@intellix
intellix / _glyphicons.scss
Created January 22, 2015 10:32
glyphicon-pro CSS consistent with Bootstrap naming
//
// Glyphicons for Bootstrap
//
// Since icons are fonts, they can be placed anywhere text is placed and are
// thus automatically sized to match the surrounding child. To use, create an
// inline element with the appropriate classes, like so:
//
// <a href="#"><span class="glyphicon glyphicon-star"></span> Star</a>
// Import the fonts
@intellix
intellix / Dockerfile
Created February 6, 2015 14:06
Recipe for prerender
# Prerender server with S3 cache
FROM dockerfile/nodejs
RUN apt-get update -y
RUN apt-get install -y \
python2.7 python-pip \
libfreetype6 libfontconfig
RUN cd / && git clone https://github.com/prerender/prerender
@intellix
intellix / build.js
Created February 9, 2015 10:48
gulp deploy task for creating a number incremented folder for symlinking to
/**
* For creating a numbered folder inside /deploys,
* shoving in the contents of /dist and for symlinking to when happy. Eg:
* /deploys/2
* /www --> symlinks to --> /deploys/2
*/
gulp.task('deploy', function (cb) {
var deploys = fs.readdirSync('./deploys');
var version = 1;
if (deploys.length) {
@intellix
intellix / btn-thinking.js
Created March 3, 2015 12:50
Thinking button in angular
'use strict';
angular.module('app.common').directive('btnThinking', function($compile) {
return {
restrict: 'A',
link: function (scope, element, attrs)
{
var html = element.html();
attrs.$observe('btnThinking', function(thinking) {
@intellix
intellix / SassMeister-input.scss
Created September 14, 2015 15:28
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$text-color-primary: #fff;
$headings-font-family: Arial;
.btn {
&.btn-primary,