Skip to content

Instantly share code, notes, and snippets.

##
# Calendar helper with proper events
# http://www.cuppadev.co.uk/webdev/making-a-real-calendar-in-rails/
#
# (C) 2009 James S Urquhart (jamesu at gmail dot com)
# Derived from calendar_helper
# (C) Jeremy Voorhis, Geoffrey Grosenbach, Jarkko Laine, Tom Armitage, Bryan Larsen
# Licensed under MIT. http://www.opensource.org/licenses/mit-license.php
##
#! /bin/bash
### BEGIN INIT INFO
# Provides: gitlab
# Required-Start: $local_fs $remote_fs $network $syslog redis-server
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: GitLab git repository management
# Description: GitLab git repository management
### END INIT INFO
@troszok
troszok / gist:2983706
Created June 24, 2012 15:35
gitlab_nginx.conf
upstream gitlab {
server unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket;
}
server {
listen YOUR_SERVER_IP:80;
server_name gitlab.YOUR_DOMAIN.com;
root /home/gitlab/gitlab/public;
# individual nginx logs for this gitlab vhost
@troszok
troszok / logstash_cleanup_es.rb
Created July 18, 2013 08:47
Cleanup logstash elasticsearch indexes
aliases = Tire::Configuration.client.get("#{Tire::Configuration.url}/_aliases")
JSON.parse(aliases.body).keys.select{|v| v =~ /^logstash/i }.each do |n|
Tire::Index.new(n).delete
end
@troszok
troszok / install_jenkins_on_ubuntu.sh
Last active August 29, 2015 13:57
install_jenkins_on_ubuntu.sh
# run it with command:
# bash -c "$(curl -fsSL https://gist.github.com/troszok/9598077)"
# wget -O - https://gist.github.com/troszok/9598077 | bash
sudo apt-get -q -y install software-properties-common python-software-properties
sudo add-apt-repository ppa:webupd8team/java
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list
apt-get update -y
@troszok
troszok / designer.html
Created October 18, 2014 14:46
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@troszok
troszok / designer.html
Created October 19, 2014 06:00
designer
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
require "formula"
class Elasticsearch < Formula
homepage "http://www.elasticsearch.org"
url "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.0.Beta1.tar.gz"
sha1 "5e3d07fdf2d5aab75d49b38fa6743b43f07eef70"
depends_on :java => "1.7"
head do
-- Index hit rate
WITH idx_hit_rate as (
SELECT
relname as table_name,
n_live_tup,
round(100.0 * idx_scan / (seq_scan + idx_scan),2) as idx_hit_rate
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC
),
@troszok
troszok / some_spec.rb
Created January 21, 2015 15:03
vcr_for_amazon
# based on that: http://myronmars.to/n/dev-blog/2011/10/custom-request-matchers-in-vcr-2-0
uri_without_timestamp = VCR.request_matchers.uri_without_param("Timestamp", "Signature")
context "amazon integration", vcr: {record: :once, :match_requests_on => [:method, uri_without_timestamp]} do
end