This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>example</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+--------------------------------------------+--------+ | |
| Metadata | | |
+--------------------------------------------+--------+ | |
| Type | Result | | |
+--------------------------------------------+--------+ | |
| number_of_words | 454 | | |
| number_of_characters | 3150 | | |
| number_of_characters_excluding_white_space | 2690 | | |
| number_of_sentences | 54 | | |
| number_of_paragraphs | 5 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
#encoding: UTF-8 | |
require 'terminal-table' | |
require 'histogram/array' | |
# Usage: | |
# echo "a e i o u" | word_histogram | |
top_words = 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define("DB_DSN", "mysql:host=localhost;dbname=DATABASE_NAME_GOES_HERE"); | |
define("DB_USERNAME", ""); | |
define("DB_PASSWORD", ""); | |
// Example usage | |
function mysql_custom_query() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app') | |
.filter('timeAgo', function() { | |
return function(input) { | |
var res = '', | |
day = 24 * 60 * 60 * 1000, | |
hour = 60 * 60 * 1000, | |
minute = 60 * 1000, | |
second = 1000, | |
difference = new Date() - new Date(input); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
angular | |
.module('edustorage.hosts') | |
.config(configure); | |
configure.$inject = ['$routeProvider']; | |
function configure($routeProvider) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
angular | |
.module('edustorage.requests') | |
.config(configure); | |
configure.$inject = ['$routeProvider']; | |
function configure($routeProvider) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- | |
In this example, I started with the 5-minute example provided by Google | |
on the following page: | |
https://developers.google.com/drive/ | |
I modified the example code, so that I could write the following |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getPaginator($current_page, $total_pages, $boundaries, $around) { | |
$paginator = array(); | |
$suspensionPoints = false; | |
$paginator[$total_pages] = null; | |
$paginator[$current_page] = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "awesome_print" | |
def pagination(current_page, total_pages, boundaries, around) | |
elements = [] | |
# add boundaries elements | |
(1..boundaries).to_a.each { |val| | |
elements.push(val) | |
elements.push(total_pages-val+1) | |
} |