Skip to content

Instantly share code, notes, and snippets.

View regedarek's full-sized avatar
🏠
Working from home

Darek Finster regedarek

🏠
Working from home
View GitHub Profile
@regedarek
regedarek / _form.html.erb
Created April 15, 2024 12:13 — forked from dalezak/_form.html.erb
Stimulus.js Toggle Controller to show and hide form elements based on select value
<div class="form-group">
<%= form.label :type, "Type", class: "font-weight-bold" %>
<%= form.select :type, ['TextQuestion', 'UrlQuestion'], { include_blank: true }, { class: "form-control", data: { action: "input->toggle#changed", target: "toggle.select" } } %>
</div>
<div class="form-group">
<%= form.label :name, "Name", class: "font-weight-bold" %>
<%= form.text_field :name, class: "form-control" %>
</div>
<div class="form-group" data-target="toggle.element" data-values="UrlQuestion">
<%= form.label :url, "URL", class: "font-weight-bold" %>
@regedarek
regedarek / pza-kamal-deployment.md
Last active April 10, 2024 10:35
Rails 7.1 + Kamal on OVH server
ssh ubuntu@146.59.94.122
sudo passwd root
sudo su
local: cat ~/.ssh/id_rsa.pub
@regedarek
regedarek / table_count.sql
Last active September 23, 2019 12:32
Sprawdzenie ilości wszystkich tabel w bazie danych
1.Wejście do bazy
psql kw_app_production
2. Funkcja do liczenia ilości rekordów
CREATE TYPE table_count AS (table_schema TEXT,table_name TEXT, num_rows INTEGER);
CREATE OR REPLACE FUNCTION count_em_all () RETURNS SETOF table_count AS '
DECLARE
the_count RECORD;
t_name RECORD;
@regedarek
regedarek / _login_layer.html.slim
Last active October 12, 2015 11:54
Login layer styling
- if !current_user.logged_in? && params[:login] == 'true'
.login-layer-modal.js-show-login-layer
.login-layer-modal__header
h1 = 'Jetz einloggen'
br
.login-layer-modal__form
= form_tag(login_form.url) do
fieldset
= label_tag('login_form[username]', t('login_layer.username', default: 'Username'))
= text_field_tag('login_form[username]')
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'chriskempson/base16-vim'
Plugin 'itchyny/lightline.vim'
Plugin 'maxbrunsfeld/vim-yankstack'
Plugin 'kien/ctrlp.vim'
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'bling/vim-airline'
Plugin 'edkolev/tmuxline.vim'
Plugin 'Zuckonit/vim-airline-tomato'
Plugin 'chriskempson/base16-vim'
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'bling/vim-airline'
Plugin 'edkolev/tmuxline.vim'
@reloadWindow = ->
# window cannot be reloaded in jasmine tests
{ }
class FileUploadStub
constructor: ($el, options) ->
@done = options.done
@$el = $el
@addEventListeners
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'bling/vim-airline'
Plugin 'edkolev/tmuxline.vim'
Plugin 'Zuckonit/vim-airline-tomato'
Plugin 'chriskempson/base16-vim'

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software