Skip to content

Instantly share code, notes, and snippets.

@taly2808
taly2808 / excerpt.js
Last active August 29, 2015 14:21 — forked from mrmwiebe/excerpt.js
// # Excerpt Helper
// Usage: `{{excerpt}}`, `{{excerpt words="50"}}`, `{{excerpt characters="256"}}`
//
// Attempts to remove all HTML from the string, and then shortens the result according to the provided option.
//
// Defaults to words="50"
/*
Added optional ability to use 2 <!--excerpt--> tags in your posts to specify exactly what will be
@taly2808
taly2808 / page.hbs
Last active August 29, 2015 14:21 — forked from geekhunger/page.hbs
...
{{> posts_list}}
...
@taly2808
taly2808 / app.scss
Last active August 29, 2015 14:17 — forked from malixsys/app.scss
form i.icon.error {
color: $assertive;
}
form input + i.icon.error {
display: none;
margin-left: 8px;
}
form.ng-submitted input.ng-invalid + i.icon.error {
// Requires the Toast plugin: https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin
// And Ionic Framework: http://ionicframework.com
// ngCordova is used here, but easily removed: http://ngcordova.com/
// When running in Cordova, show the native toast. Outside of Cordova, show an Ionic Popup for the same period of time.
// Uses the API for the Toast plugin - message, duration, position.
// Differences are that: Ionic Popup ignores position, and doesn't allow doing anything while it shows.
.factory('Toast', function($rootScope, $timeout, $ionicPopup, $cordovaToast) {
return {
show: function (message, duration, position) {
// 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.
@taly2808
taly2808 / contact.html
Created October 23, 2014 02:47
update pages/contact.html with contact list
<i class="fa fa-envelope fa-5x" style="color: red;"></i>
<h3>{{flash}}</h3>
<ul class="list-group">
<li class="list-group-item" ng-repeat="user in users">
<a href="#contact/{{user.id}}">{{user.name}}</a>
</li>
</ul>
<h3>This is detail for contact #{{userId}}</h3>
<i class="fa fa-envelope fa-5x" style="color: red;"></i>
<h3>{{flash}}</h3>
<h2>{{flash}}</h2>
<div class="jumbotron">
<img src="{{img}}" />
<h1>{{flash}}</h1>
</div>