Skip to content

Instantly share code, notes, and snippets.

View moqada's full-sized avatar

Masahiko Okada moqada

View GitHub Profile
@karmi
karmi / .gitignore
Created March 16, 2012 16:09
Bootstrap, install and configure ElasticSearch with Chef Solo
.DS_Store
Gemfile.lock
*.pem
node.json
tmp/*
!tmp/.gitignore
@troelskn
troelskn / app.rb
Last active August 12, 2021 17:25 — forked from dstrelau/app.rb
Gollum protected by HTTP Basic
require 'gollum/frontend/app'
require 'digest/sha1'
class App < Precious::App
User = Struct.new(:name, :email, :password_hash, :can_write)
before { authenticate! }
before /^\/(edit|create|delete|livepreview|revert)/ do authorize_write! ; end
helpers do
@elutz
elutz / controller.js
Created November 27, 2012 08:56
File Upload with AngularJS & File-Upload jQuery Plugin
function AttachmentCtrl($scope, $location, $timeout, Docs) {
$(function() {
$('#detail-form-doc').fileupload({
dataType: 'json',
url: '/angular-ib/app/fileupload?id=' + $location.search().id,
add: function(e, data) {
$scope.$apply(function(scope) {
// Turn the FileList object into an Array
for (var i = 0; i < data.files.length; i++) {
$scope.project.files.push(data.files[i]);
@moqada
moqada / node-example.json
Last active December 11, 2015 11:58
setup for coookbook-omnigollum-site
{
"run_list": [
"recipe[htpasswd]",
"recipe[omnigollum_site]"
],
"omnigollum_site": {
"base_path": "/home/gollum/wiki",
"wiki_source": "",
"repository": "git://github.com/moqada/omnigollum-site.git",
"ldap": {