Hi,
You can use the below scrip to send thank you notes to your friends who wished for your birthday on your Facebook timeline.
Instructions:
#Get the Facebook access token:
Hi,
You can use the below scrip to send thank you notes to your friends who wished for your birthday on your Facebook timeline.
Instructions:
#Get the Facebook access token:
{% if paginator.total_pages > 1 %} | |
<p> | |
{% if paginator.previous_page == 1 %} | |
<a href="{{ '/blog/' | prepend: site.baseurl }}">previous</a> | |
{% elsif paginator.previous_page %} | |
<a href="{{ paginator.previous_page_path | prepend: site.baseurl }}">previous</a> | |
{% else %} | |
previous | |
{% endif %} |
This pagination liquid code is an extract of the public repository from http://nicolas-hoizey.com/, where you can see it in action.
$ ab -c 1 -n 1000 http://127.0.0.1:3000/home | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 127.0.0.1 (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests |
global | |
log 127.0.0.1 local2 info | |
pidfile /var/run/haproxy.pid | |
stats socket /var/run/haproxy.stat mode 600 level admin | |
#debug | |
defaults | |
mode http | |
log global |
Here is a simple jQuery plugin to make a table header fixed on top of a div when this is scrolled. | |
Using the code from twitter bootstrap documentation page, this code is customized for table header. | |
Create the table with following layout - | |
<div class="row fixed-table"> | |
<div class="table-content"> | |
<table class="table table-striped table-fixed-header" id="mytable"> | |
<thead class="header"> | |
<tr> | |
<th>Email Address</th> |
# By Steve Leung | |
# steve@leungs.me | |
class ActiveRecord::Relation | |
# temporarily hack for allowing combining scopes with OR | |
# doesn't add the join tables so need to use .includes manually | |
# ie. Jobship.includes(:job).or(Jobship.accepted, Jobship.declined).count | |
def or(*scopes) | |
clauses = *scopes.map do |relation| |
angular.module('testApp', []). | |
directive('lazyLoad', ['$window', '$q', function ($window, $q) { | |
function load_script() { | |
var s = document.createElement('script'); // use global document since Angular's $document is weak | |
s.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize'; | |
document.body.appendChild(s); | |
} | |
function lazyLoadApi(key) { | |
var deferred = $q.defer(); | |
$window.initialize = function () { |
<?php | |
$number = "\d*(?:\.\d+)?"; // It's a reference to use in other cases that matches any kind of number/float | |
$width = "(?<w>(?:$number)?%?)?"; // This is the first part, the width | |
$height = "(?:x(?<h>(?:$number)?%?))?"; // Here is the height, the same as "width" but starting with an "x" | |
$aspect = "[!><@^]"; // These are the different filters one can use to stretch, shrink, etc. | |
$size = "$width$height"; // To match any size we need width and height at least (aspect comes later) |