Skip to content

Instantly share code, notes, and snippets.

View pakMann's full-sized avatar

Arman Adhitama pakMann

  • independent
  • Cimahi, Indonesia
View GitHub Profile
@pakMann
pakMann / elasticsearch.conf
Created January 7, 2018 15:46 — forked from andrewvc/elasticsearch.conf
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]
@pakMann
pakMann / video_uploader.rb
Created July 10, 2016 23:26 — forked from jirikolarik/video_uploader.rb
CarrierWave FFmpeg Uploader example
class VideoUploader < CarrierWave::Uploader::Base
include ::CarrierWave::Backgrounder::Delay
include CarrierWave::FFmpeg
RESOLUTIONS = [
{ version: :p1080, resolution: '1920x1080'},
{ version: :p720, resolution: '1280x720'}
]
# Choose what kind of storage to use for this uploader:
@pakMann
pakMann / ImageUploader
Created July 10, 2016 01:38 — forked from ahamid/ImageUploader
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}"
@pakMann
pakMann / Checkbox and Radio mixin
Created May 15, 2016 21:12 — forked from b-ry/Checkbox and Radio mixin
Sass mixin for checkbox and radio replacement
//Checkbox icon replacement
//$cb-icon = calss name of icon
//$cb-icon-checked = class name for checked icon
@mixin checkbox ($cb-icon, $cb-icon-checked) {
%checked {
@extend %icon;
@extend .#{$cb-icon-checked}:before;
text-align: center;
@pakMann
pakMann / logrotate
Last active April 14, 2023 16:28
Ubuntu 14.04 | Mina | rbenv | PostgreSQL | redis | puma | logrotate
/path/to/log/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
copytruncate
su [user] [group]
}
class Pacar
#buat dulu pacar nya
def initialize
@pacar = ['Dian','Putri','Yasmin','Rena'] #<~ nama calon pacarnya
@tipe = ['lucu','cantik','imut','ngegemesin'] #<~ tipe nya
@gaada = "! eh ga jadi ternyata gapunya :(" #<~ kalo gapunya...
end
# Aku pengen cari pacar...
def cari_pacar(target = nil)
for i in $(git branch | sed 's/^.//'); do git checkout $i; git pull --rebase origin master; done
@pakMann
pakMann / SassMeister-input.scss
Created April 23, 2014 17:24
Generated by SassMeister.com.
// ----
// Sass (v3.3.5)
// Compass (v1.0.0.alpha.18)
// ----
@for $i from 1 through 3 {
.parent-#{$i} {
.child {
margin: 10px * $i, (10px * $i) + 10;
}
@pakMann
pakMann / dabblet.css
Created October 2, 2013 12:32
Untitled
background: #f06;
background: linear-gradient(45deg, orangered, yellow);
min-height: 100%;
@pakMann
pakMann / sticky.js
Last active October 13, 2015 15:38
sticky menu on header
$topContent = $("#homepage")
$nav = $(".navbar")
navHeight = $nav.outerHeight(false)
stickyNav = ->
browserHeight = $(window).height()
navTopPos = browserHeight - navHeight
$topContent.css height: navTopPos
scrollTop = $(window).scrollTop()
if scrollTop > navTopPos
$nav.css