Skip to content

Instantly share code, notes, and snippets.

View Fire-Dragon-DoL's full-sized avatar

Francesco Belladonna Fire-Dragon-DoL

View GitHub Profile
@Fire-Dragon-DoL
Fire-Dragon-DoL / manual_preloading.rb
Created April 28, 2022 22:43 — forked from sobstel/manual_preloading.rb
Rails manual association preloading
# taken from https://mrbrdo.wordpress.com/2013/09/25/manually-preloading-associations-in-rails-using-custom-scopessql/
# collection association e.g. has_many
owners = People.all
association_name = :photos
owners.each do |owner|
records = Array(whatever_you_want)
@Fire-Dragon-DoL
Fire-Dragon-DoL / 00-throttle-zoom
Last active June 29, 2023 14:51 — forked from abraithwaite/chill-zoom.sh
FEDORA version - Zoom in Systemd Cgroups on Linux. Change the max allocations to fit your workstation.
#!/usr/bin/env bash
# throttle-zoom '0-1' '6G'
set -xe
main() (
allowedCpus="${1?Missing allowed CPUs, ex: 0-4}"
maxMemory="${2?Missing max memory, ex: 6G}"
@Fire-Dragon-DoL
Fire-Dragon-DoL / whiteboardCleaner.md
Created March 10, 2019 00:24 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: postgresql
encoding: utf8
database: nome_del_db
bundle exec rspec spec/controllers/readers_controller_spec.rb
..FF**
Pending:
ReadersController POST create when save message returns to true redirects to root url
# Not yet implemented
# ./spec/controllers/readers_controller_spec.rb:45
ReadersController POST create when save message returns to true assigns a success flash message
# Not yet implemented
# ./spec/controllers/readers_controller_spec.rb:46
tile init nooverrides
set %grid_size 0
sub scangrid
for %x -20 20
{
for %y -20 20
{
set %posX #charposx + %x
set %posY #charposy + %y
@echo off
echo Configuring MESA environment variables for Dota 2.
echo Credits http://puppet-master.net by Nicolas.Kirsch
call "..\..\config\mesa_check_env.bat"
SET SOURCE_BIN_PATH=%STEAMDIR%\steamapps\common\dota 2 beta\bin
SET GAME_PROJECT=%STEAMDIR%\steamapps\common\Dota 2 beta\dota
SET GAME_PROJECT_SRC=%MESADIR%\projects\Dota_2_src
SET GAME_PROJECT_NAME="dota"
@echo off
echo Configuring MESA environment variables for Dota 2.
echo Credits http://puppet-master.net by Nicolas.Kirsch
call "..\..\config\mesa_check_env.bat"
SET SOURCE_BIN_PATH=%STEAMDIR%\steamapps\common\dota 2 beta\bin
SET GAME_PROJECT=%STEAMDIR%\steamapps\common\Dota 2 beta\dota2
SET GAME_PROJECT_SRC=%MESADIR%\projects\Dota_2
SET GAME_PROJECT_NAME="Dota 2"
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
{
"total": 8084,
"results": [
{
"cap": 35031,
"id": 8085,
"name": "Abano Terme",
"province": "PD",
"state_id": 25
},