Skip to content

Instantly share code, notes, and snippets.

View huned's full-sized avatar
💭
I may be slow to respond.

Huned Botee huned

💭
I may be slow to respond.
View GitHub Profile
@huned
huned / eos-post-install.sh
Created February 18, 2021 21:02 — forked from diniremix/eos-post-install.sh
elementaryOS post install
# elementary OS Juno post install
# first step, upgrade
sudo apt update && sudo apt upgrade
sudo apt install ubuntu-restricted-extras
sudo apt install software-properties-common --no-install-recommends
sudo apt install libavcodec-extra ffmpeg
sudo apt install firefox vlc
sudo apt install screenfetch flameshot
@huned
huned / ladder.md
Last active May 5, 2020 22:11 — forked from jamtur01/ladder.md
[PROPOSAL] ZeroCater Engineering Ladder
set :rails_env, :production
set :unicorn_binary, "/usr/bin/unicorn"
set :unicorn_config, "#{current_path}/config/unicorn.rb"
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
namespace :deploy do
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D"
end
task :stop, :roles => :app, :except => { :no_release => true } do
@huned
huned / rbenv-install-system-wide.sh
Created March 15, 2012 20:30
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
@huned
huned / rails_admin_without_devise.md
Created August 31, 2011 18:33 — forked from Overbryd/rails_admin_without_devise.md
Using RailsAdmin without devise

Using rails_admin without devise

Having a buckload of code to authorize users on your application is something you may like or not. Speaking for myself I hate it. But I still love rails_admin, here's how you install it without devise. Thanks to phoet for providing the hints in the gist I have forked from.

Add RailsAdmin to your Gemfile

do NOT add devise

gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName example.com
ServerAlias www.example.com
DocumentRoot "/home/example/apps/example_app/current/public"
<Directory "/home/example/apps/example_app/current/public">
Options -Indexes +FollowSymLinks -MultiViews -Includes
AllowOverride None
steve souders
9%/91% backend / frontend
site speed => google page rank
google webmaster tools, yslow, page speed
webpagetest.org
video, screenshot timeline
overwrite document.write
html5 iframe
increase browser disk cache
progressive rendering
=rounded(!width=3px)
:-webkit-border-radius = !width
:-moz-border-radius = !width
=shadow(!alpha=0.2, !x=0px, !y=1px, !radius=5px)
:-webkit-box-shadow rgba(0, 0, 0, #{!alpha}) #{!x} #{!y} #{!radius}
:-moz-box-shadow rgba(0, 0, 0, #{!alpha}) #{!x} #{!y} #{!radius}
=background_gradient(!from, !to)
:background-color = !from
#!/usr/bin/env ruby
# calculate average uptime of my machine
require 'rubygems'
require 'activesupport'
times = `last | grep ^shutdown`
times = times.map { |l| Time.parse l[/shutdown\s+~\s+(.*)/, 1] }
times = times.map { |t| t > Time.now ? t - 1.year : t }
diffs = times.zip(times[1 .. -1]).map { |(a, b)| a - b if b }.compact