Skip to content

Instantly share code, notes, and snippets.

View gnomex's full-sized avatar

Kenner Kliemann gnomex

View GitHub Profile
@gnomex
gnomex / Preferences.sublime.settings
Last active December 21, 2015 20:29
My sublime-text user configs
{
"auto_complete": true,
"auto_complete_selector": "source - comment",
"auto_indent": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"detect_indentation": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_size": 15,
x = [1,2,3]
x.send :[]=,0,2
x[0] + x.[](1) + x.send(:[],2)
@gnomex
gnomex / javaPog
Created November 1, 2013 15:25
Sometimes, happen!
public Boolean haveInstructions(Integer currentIndex) {
try {
instructions.get(currentIndex);
return Boolean.TRUE;
} catch(IndexOutOfBoundsException e) {
return Boolean.FALSE;
}
}
@gnomex
gnomex / gist:7908432
Created December 11, 2013 10:50
Sometimes heappens
def up_stock(quantity = nil)
#...
render nothing: true
end
<% flash.each do |name, message| %>
<div class="alert alert-<%= name == :notice ? "success" : "error" %>">
<a class="close" data-dismiss="alert" href="#">×</a>
<%= message %>
</div>
<% end %>
@gnomex
gnomex / whenever_wiki.markdown
Last active August 29, 2015 13:56
Whenever overview

Whenever

Cron jobs in Ruby

Como funciona

Providencia uma forma fácil de criar e agendar jobs no cron

Através do arquivo (`config/schedule.rb`) são descritas tasks, que serão agendadas no cron

As tarefas são executadas através do Rails runner command (`rails runner`)
@gnomex
gnomex / pg_steps.md
Last active May 11, 2017 02:05
PostgreSQL First Steps on Linux
  1. sudo -u postgres psql template1
  2. ALTER USER postgres with encrypted password 'xxxxxxx';
  3. sudo subl /etc/postgresql/9.3/main/pg_hba.conf
#And change "peer" to "md5" on the line concerning postgres :
local      all     postgres     peer md5
  1. sudo /etc/init.d/postgresql restart
@gnomex
gnomex / eclipse.desktop
Created March 7, 2014 00:22
Eclipse gnome launcher
[Desktop Entry]
Version=1.0
Type=Application
Name=Eclipse SDK
GenericName=Java editor
Exec=/opt/eclipse/eclipse
Terminal=false
MimeType=text/plain;
Icon=/opt/eclipse/icon.xpm
Categories=Development;
@gnomex
gnomex / install_toolbox.md
Last active February 16, 2021 01:11
Octave with Fuzzy logic toolbox

Octave

GNU Octave is a high-level interpreted language, primarily intended for numerical computations. It provides capabilities for the numerical solution of linear and nonlinear problems, and for performing other numerical experiments.
[GNU Octave](http://www.gnu.org/software/octave/)

How to install

# apt-get install octave
ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host