Skip to content

Instantly share code, notes, and snippets.

View vaskaloidis's full-sized avatar

Vas Kaloidis vaskaloidis

View GitHub Profile
#!/usr/bin/env ruby
# proofj.rb - tests the proof:
# If m is any even integer, then (−1)𝑚+3 = −1.
# Config
verbose = true
super_verbose = false
# Iteration Boundaries
start_number = -10
@vaskaloidis
vaskaloidis / hash_arbuments.rb
Created August 11, 2018 22:05
Hash Arguments Notes
# Hash Method Arguments
def foo(b: 2, c: 3, **args)
puts b #=> 2
puts args #=> {a: 1, d: 4}
end
# Usage: foo(a: 1, b: 2, c: 3, d: 4)
# Explination:
@vaskaloidis
vaskaloidis / rails-app-generator-example.rb
Created May 27, 2018 04:23 — forked from andrewle/clever-rails.rb
A Rails app generator tuned my common needs
#!/usr/bin/env ruby
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
require "active_support/core_ext/string/strip"
class CleverAppGenerator < Rails::Generators::AppGenerator
class_option :skip_bundle, default: true
class_option :database, default: "postgresql"
class_option :skip_test_unit, default: true, hide: true
0431308ee286a3fe630c7a1e1f30e849565b405afaccd747df5638b8f75ca2a598a312b3aa7de2d31698f875a7955d8852ea32d7ed6b140868402856515418166e;mythic-forge-test
@vaskaloidis
vaskaloidis / 0_reuse_code.js
Created January 22, 2017 09:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# rules.toml
[web]
address = ":8081"
[docker]
domain = "mysite.io"
watch = true
swarmmode = true
@vaskaloidis
vaskaloidis / schema.rb
Created January 10, 2017 01:19
My Schema.rb file
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
Started GET "/apps?name=this-does-not-exist" for ::1 at 2016-12-18 13:23:18 -0500
Processing by AppsController#index as JSON
Parameters: {"name"=>"this-does-not-exist"}
App Load (0.6ms) SELECT "apps".* FROM "apps"
{:json=>#<ActiveRecord::Relation [#<App id: 1, name: "App-Name 0", api_key: nil, api_secret: nil, created_at: "2016-12-18 16:14:40", updated_at: "2016-12-18 16:14:40", builder_lock: false, auth_token: nil>, #<App id: 2, name: "App-Name 1", api_key: nil, api_secret: nil, created_at: "2016-12-18 16:14:40", updated_at: "2016-12-18 16:14:40", builder_lock: false, auth_token: nil>, #<App id: 3, name: "App-Name 2", api_key: nil, api_secret: nil, created_at: "2016-12-18 16:14:40", updated_at: "2016-12-18 16:14:40", builder_lock: false, auth_token: nil>, #<App id: 4, name: "App-Name 3", api_key: nil, api_secret: nil, created_at: "2016-12-18 16:14:40", updated_at: "2016-12-18 16:14:40", builder_lock: false, auth_token: nil>, #<App id: 5, name: "App-Name 4", api_key: nil, api_secret: nil, created_at: "20
tidbits master % rails generate npm_pipeline:brunch
identical package.json
identical brunch-config.js
append app/assets/stylesheets/application.css
/Users/vasilioskaloidis/Code/Rails/tidbits/vendor/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/inject_into_file.rb:98:in `binread': No such file or directory @ rb_sysopen - /Users/vasilioskaloidis/Code/Rails/tidbits/app/assets/stylesheets/application.css (Errno::ENOENT)
from /Users/vasilioskaloidis/Code/Rails/tidbits/vendor/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/inject_into_file.rb:98:in `replace!'
from /Users/vasilioskaloidis/Code/Rails/tidbits/vendor/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/inject_into_file.rb:59:in `invoke!'
from /Users/vasilioskaloidis/Code/Rails/tidbits/vendor/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
from /Users/vasilioskaloidis/Code/Rails/tidbits/vendor/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/inject_into_file.rb:30:in `insert_into_file'
from /Users/vasilioskaloidis/Code/Rails/tidbits/v
@vaskaloidis
vaskaloidis / liferay-ignore.txt
Created November 18, 2016 10:00
The .gitignore file for Liferay, as a text file.
!/sql/update-*.sql
**/.gradle
**/.settings
**/.sonar
**/pmd-reports
*.bak
*.iml
*.ipr
*.iws
*.swp