Skip to content

Instantly share code, notes, and snippets.

View vitalyrotari's full-sized avatar
🦥
I may be slow to respond.

Vitaly Rotari vitalyrotari

🦥
I may be slow to respond.
  • Everywhere
  • Chisiau, Moldova Republic of
  • 06:46 (UTC +03:00)
View GitHub Profile
@vitalyrotari
vitalyrotari / make-password.sh
Created April 1, 2014 10:52
RethinkDB Admin Panel Security
htpasswd -bc /etc/nginx/.rethinkdb.pass user password
@vitalyrotari
vitalyrotari / rdb.conf
Created April 1, 2014 10:50
RethinkDB Configuration Example
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
#!/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
#!/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 = {
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.
@vitalyrotari
vitalyrotari / bootstrap.php
Created February 26, 2014 16:40
Zend Framework 1+ Angular $http.post fix
<?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');
<!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">
/* 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);
},
@vitalyrotari
vitalyrotari / gist:6426228
Created September 3, 2013 16:31
AngularJS safe apply helper
/**
* @param {Scope} scope
* @param {Function} callback
*/
angular.safeApply = function (scope, callback) {
scope[(scope.$$phase || scope.$root.$$phase) ? '$eval' : '$apply'](callback || function() {});
};
@vitalyrotari
vitalyrotari / demo.md
Last active December 21, 2015 12:49
Canvas Pie Progress