This file contains 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
htpasswd -bc /etc/nginx/.rethinkdb.pass user password |
This file contains 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
rdb1: | |
# Give this file the extension .conf and put it in /etc/rethinkdb/instances.d in order to enable it. | |
# It is generally necessary to run | |
# rethinkdb create -d /var/lib/rethinkdb/instances.d/default ; | |
# as the target user before enabling this configuration. | |
runuser=root | |
rungroup=root | |
directory=/var/lib/rethinkdb/instances.d/default | |
pid-file=/var/run/rethinkdb/instances.d/default.pid | |
driver-port=28015 |
This file contains 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/env ruby | |
require 'pygmentize' # gem install pygmentize | |
require 'selenium-webdriver' # gem install selenium-webdriver | |
exit unless code_path = ARGV.shift | |
file_path = File.absolute_path 'code.html' | |
image_path = File.absolute_path 'code_image.png' | |
code = Pygmentize.process File.read(code_path), :ruby | |
html = <<-EOT |
This file contains 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/env ruby | |
# Author : Emad Elsaid (https://github.com/blazeeboy) | |
# Idea of : Thibault (@EyeWriteCode) | |
require 'Twitter' #gem install twitter | |
begin | |
# Create a read application from : | |
# https://apps.twitter.com | |
# authenticate it for your account | |
# fill in the following | |
config = { |
This file contains 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 'formula' | |
class UniversalPython < Requirement | |
satisfy(:build_env => false) { archs_for_command("python").universal? } | |
def message; <<-EOS.undent | |
A universal build was requested, but Python is not a universal build | |
Boost compiles against the Python it finds in the path; if this Python | |
is not a universal build then linking will likely fail. |
This file contains 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 | |
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
public function _initPostPayload() | |
{ | |
$headers = getallheaders(); | |
if ('POST' == $_SERVER['REQUEST_METHOD'] && preg_match('/^application\/json/', $headers['Content-Type'])) { | |
$data = file_get_contents('php://input'); |
This file contains 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 ng-app="Demo" ng-controller="AppController"> | |
<head> | |
<meta charset="utf-8" /> | |
<title> | |
Lazy Loading Images With AngularJS | |
</title> | |
<style type="text/css"> |
This file contains 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
/* Based on | |
* - EGM Mathematical Finance class by Enrique Garcia M. <egarcia@egm.co> | |
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1) | |
*/ | |
var ExcelFormulas = { | |
PVIF: function(rate, nper) { | |
return Math.pow(1 + rate, nper); | |
}, |
This file contains 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
/** | |
* @param {Scope} scope | |
* @param {Function} callback | |
*/ | |
angular.safeApply = function (scope, callback) { | |
scope[(scope.$$phase || scope.$root.$$phase) ? '$eval' : '$apply'](callback || function() {}); | |
}; |