Skip to content

Instantly share code, notes, and snippets.

View vaskaloidis's full-sized avatar

Vas Kaloidis vaskaloidis

View GitHub Profile
<script>
window.onload = function() {
var target = document.getElementById('revealthis');
if( $('#yourtarget').is(':empty') ) {
target.style.display = 'block';
} else {
target.style.display = 'none';
}
#!/bin/sh
for file in *_h.png
do
mv "$file" "${file}/_h.png/_half.png"
done

Installed Apps

task

#!/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
# rules.toml
[web]
address = ":8081"
[docker]
domain = "mysite.io"
watch = true
swarmmode = true
@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
@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).
#