Skip to content

Instantly share code, notes, and snippets.

View dalpo's full-sized avatar
💭
I'm still learning...

Andrea Dal Ponte dalpo

💭
I'm still learning...
View GitHub Profile
@benoittgt
benoittgt / file.vim
Last active April 6, 2024 10:28
iamaputsemojidebugger
function! IAmAPutsEmojiDebugger()
ruby <<EOS
separator = rand(0x1F601..0x1F64F).chr('UTF-8')
VIM::command("normal! oputs '#{separator}' * (`tput cols`.to_i / 2)")
VIM::command('normal! oputs "#{__FILE__}:#{__LINE__}"')
VIM::command("normal! oputs '#{separator}' * (`tput cols`.to_i / 2)")
EOS
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@bettio
bettio / Blink.ex
Created November 22, 2018 19:44
Blinking a Led in Elixir on ESP32 with AtomVM
@jodosha
jodosha / README.md
Created September 7, 2017 14:34
Mount Hanami inside Rails

1. Setup

rails new blog
cd blog
hanami new bookshelf
vim Gemfile # add `hanami`
bundle
vim bookshelf/config/environment.rb # See Note 1
@lucaspiller
lucaspiller / _fields.html.slim
Last active June 26, 2021 23:03
Reform 2.2 nested form (with support for cocoon gem)
= f.simple_fields_for :inputs do |input|
= render 'input_fields', f: input
.links
= link_to_add_association f, :inputs, partial: 'input_fields', force_non_association_create: true do
Add
@oelmekki
oelmekki / doc.md
Created December 30, 2015 19:37
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.

@jimmynguyc
jimmynguyc / capistrano-puma-setup-first-time.txt
Last active October 9, 2016 10:46
Setup Capistrano Puma First Time
In Gemfile
=========
gem 'capistrano-rails'
gem 'capistrano-rbenv'
gem 'capistrano-rbenv-install'
gem 'capistrano-safe-deploy-to'
gem 'capistrano-sidekiq'
gem 'capistrano3-puma'
In Capfile
@potomak
potomak / style_guide.markdown
Created November 26, 2014 08:27
Addictive style guide

Javascript

  • Indent using 2 spaces
  • Use single quotes, unless you are writing JSON
  • Declare one variable per var statement
  • Variables and properties should use lower camel case capitalization
  • Class names should be capitalized using upper camel case
  • Constants should be declared as regular variables or static class properties, using all uppercase letters
  • Use the triple equality operator
@gbuesing
gbuesing / ml-ruby.md
Last active February 28, 2024 15:13
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems

@simonbru
simonbru / Readme.txt
Last active January 6, 2024 13:05 — forked from endolith/Readme.txt
This is a Python script to extract GNOME/GTK's color scheme and apply it to Wine, so that the themes (approximately) match.
Instructions:
1. Set your Gnome theme as you would like it
2. Run with a command like "python wine_colors_from_gtk.py"
3. Restart any apps running in Wine. They should match the Gnome theme colors now.
Better description with screenshots here: http://www.endolith.com/wordpress/2008/08/03/wine-colors/
This is also stored on https://code.launchpad.net/~endolith/+junk/wine-color-scraper