Skip to content

Instantly share code, notes, and snippets.

View Tyralion's full-sized avatar

Ivan Pilyaev Tyralion

  • Russia, Chelyabinsk
View GitHub Profile
/**
* @component: Ext.FileChooser
* @version: 0.2
* @updated: 17:23 11/01/2012
*/
Ext.FileChooser = function(config) {
Ext.apply(this, config || {});
package com.zenoffice.app.services;
import android.os.AsyncTask;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
package com.zenoffice.app.ext;
import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
#!/usr/bin/env bash
if [ "$UID" -ne 0 ]
then echo "Please run this script as root user"
exit
fi
apt-get -y update
apt-get -y upgrade
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev git sqlite3 libsqlite3-dev

If you are seeing Mongo soft rlimits warnings in your logs, or a WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 when you login to mongo shell via mongo from the commandline, or any mysterious/unexplained mongo connection errors... follow this how-to exactly and it will resolve the issue for you.

(Source of this how to found at basho/basho_docs#1402)

First file: sudo vi /Library/LaunchDaemons/limit.maxfiles.plist

...containing:

@Tyralion
Tyralion / default.vcl.pl
Last active August 26, 2015 05:16 — forked from bmarini/default.vcl.pl
A good varnish config for a Rails app
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html
# https://www.varnish-cache.org/trac/wiki/VCLExamples
# Summary
# 1. Varnish will poll the backend at /health_check to make sure it is
# healthy. If the backend goes down, varnish will server stale content
# from the cache for up to 1 hour.
# 2. Varnish will pass X-Forwarded-For headers through to the backend
# 3. Varnish will remove cookies from urls that match static content file
# extensions (jpg, gif, ...)
factorial4 :: Integer -> Integer
factorial4 n | n == 0 = 1
| n > 0 = n * factorial4(n - 1)
| otherwise = error "arg must be >= 0"
-module(db).
-export([new/0, destroy/1, write/3, delete/2, read/2, match/2]).
% Создание базы
new() -> [].
% Удаление базы
destroy(_) -> ok.
% Запись в базу
;(function($) {
'use strict'
var VERSION = '0.5';
var WINDOW_TMPL = (
'<div class="modal editor-modal-win" tabindex="-1" role="dialog">' +
'<div class="modal-dialog">' +
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.