Skip to content

Instantly share code, notes, and snippets.

View JanOwiesniak's full-sized avatar

Jan Owiesniak JanOwiesniak

View GitHub Profile
@gilcierweb
gilcierweb / _form.html.erb
Last active March 20, 2021 12:49
Upload image crop with Ruby and Rails, CarrierWave and Cropper.js
#app/views/businesses/_form.html.erb
<%= form_with(model: business, scope: :business, local: true, :html => {multipart: true}) do |form| %>
<div class="row">
<div class="col-md-12">
<%= form.file_field :logo_image, id: :business_logo_image %>
<%= form.label :logo_image, class: 'upload' do %>
<i class="material-icons">file_upload</i>
<span>Choose image</span>
@dvdbng
dvdbng / vim-heroku.sh
Last active December 22, 2023 18:00
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
@tduarte
tduarte / publish-ghpages.md
Last active March 15, 2024 05:45
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@Chaser324
Chaser324 / ThreadedJob.cs
Created April 8, 2016 15:43
Unity ThreadedJob class for doing work on a separate thread and checking status or waiting on the main Unity thread.
// Source: http://answers.unity3d.com/questions/357033/unity3d-and-c-coroutines-vs-threading.html
//
// *****************************************************************************
// Example Job - Inheret from this class and override ThreadFunction:
// *****************************************************************************
// public class Job : ThreadedJob
// {
// public Vector3[] InData; // arbitary job data
// public Vector3[] OutData; // arbitary job data
//