Skip to content

Instantly share code, notes, and snippets.

View pakMann's full-sized avatar

Arman Adhitama pakMann

  • independent
  • Cimahi, Indonesia
View GitHub Profile
@GhazanfarMir
GhazanfarMir / Instructions.sh
Last active October 5, 2025 08:00
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@sergeyklay
sergeyklay / phpenv-install.md
Last active November 10, 2024 14:36
Multiple PHP versions using phpenv and php-build

Multiple PHP versions using phpenv and php-build

Install dependecies

Debian/Ubuntu users

sudo apt install \
  autoconf \
  bison \
@chsh
chsh / webapp.conf
Created May 31, 2015 07:21
AWS Elastic Beanstalk nginx webapp.conf for ruby(rails).
upstream my_app {
server unix:///var/run/puma/my_app.sock;
}
server {
listen 80;
server_name _ localhost; # need to listen to localhost for worker tier
location / {
proxy_pass http://my_app; # match the name of upstream directive which is defined above
@andrewvc
andrewvc / elasticsearch.conf
Created October 3, 2013 17:05
Upstart script for elasticsearch on ubuntu.... that actually works. Install the deb, and then run `sudo update-rc.d elasticsearch remove -f` to disable the init script.
# ElasticSearch upstart script
description "ElasticSearch service"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
@squarism
squarism / deploy.rb
Created August 21, 2012 01:37
Capistrano with zsh + nginx + passenger + rbenv
# Here's what you can do with this capistrano setup:
# > cap staging deploy:setup
# > cap staging deploy
# (create your database by hand)
# > cap staging deploy:migrate
# this is specific to my app because my fixtures are my seeds :(
# > cap staging fixtures
# same commands above with production:
require 'sprockets'
require 'uglifier'
require 'logger'
namespace :website do
desc "remove files in output directory"
task :clean do
puts "Removing output..."
Dir["html/*"].each { |f| rm_rf(f) }
@ahamid
ahamid / ImageUploader
Created May 27, 2011 16:51
CarrierWave mixed content upload processing
require 'carrierwave/processing/mini_magick'
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
IMAGE_EXTENSIONS = %w(jpg jpeg gif png)
DOCUMENT_EXTENSIONS = %w(exe pdf doc docm xls)
def store_dir
"files/#{model.id}"
@balupton
balupton / README.md
Last active February 10, 2025 05:38
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
@aurelian
aurelian / gist:534568
Created August 18, 2010 12:39
shows what before_filter is executed and where's that filter defined. useful to debug before_filter madness
puts "\033[1;31m=> Loading hacks: #{__FILE__}\033[0m"
module BeforeFilterHacks
def self.included(base)
base.class_eval { alias_method_chain :call, :hacks }
end
def call_with_hacks(controller, &block)
message= if method.kind_of?(Proc)
method.to_s