Skip to content

Instantly share code, notes, and snippets.

View alessandro-fazzi's full-sized avatar
🇺🇦

Alessandro Fazzi alessandro-fazzi

🇺🇦
View GitHub Profile
@yoren
yoren / functions.php
Last active April 20, 2020 15:38
Changing arguments for the built-in taxonomies in WordPress
<?php
function ofix_register_tax_args( $args, $taxonomy, $object_type ) {
if ( 'link_category' === $taxonomy ) {
$args['public'] = true;
$args['query_var'] = true;
}
return $args;
@mukkoo
mukkoo / media-query.sass
Created February 28, 2014 11:55
Sass media queries
$mobile-size: 320px
$tablet-size: 768px
$netbook-size: 1030px
$desktop-size: 1600px
$mobile: "all and (max-width: #{$mobile-size})"
$tablet: "all and (min-width: #{($mobile-size + 1)}) and (max-width: #{$tablet-size})"
$netbook: "all and (min-width: #{($tablet-size + 1)}) and (max-width: #{$netbook-size})"
$desktop: "all and (min-width: #{$netbook-size + 1}) and (max-width: #{$desktop-size})"
$big-desktop: "all and (min-width: #{$desktop-size + 1})"
@kartoch
kartoch / mutator.txt
Last active February 28, 2018 16:16
Muttator Cheatsheet
A Muttator Reference Sheet / Cheat Sheet
Muttator v0.6 for Thunderbird v3.0 and 3.1.* (muttator-20100629.xpi)
The main thing to know about using Muttator is that there are two primary modes, EX mode and MESSAGE mode,
and keyboard mappings can work very differently in the two modes. It's not obvious which mode you're in;
you have to look at the bottom left of your Thunderbird window where the status line with either be blank
(EX mode) or will say "-- MESSAGE --". There is also an odd "-- CARET --" mode that you'll probably want
to <ESC> out of as soon as possible.
@ebeigarts
ebeigarts / RAILS_RELATIVE_URL_ROOT.md
Last active February 2, 2023 15:16
RAILS_RELATIVE_URL_ROOT

RAILS_RELATIVE_URL_ROOT

Rails

By default RAILS_RELATIVE_URL_ROOT is used only for asset pipeline.

To namespace your rails routes you need to wrap run MyApp::Application with map in your config.ru:

map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do
@gaby-mg
gaby-mg / basic_install.sh
Last active February 19, 2016 16:57
WP: Basic Install Sript with wp-cli
#!/bin/bash
# Usage: basic-install [OPTIONS] file
#
# Index:
#
# 0.- Initial Setup and Functions
# 1.- Set your server correctly
# 2.- Install latest WordPress version
# 3.- Set up anti-spam and security measures
@matjack1
matjack1 / mt_bot.rb
Created October 25, 2012 20:17
mt_bot
require 'rubygems'
require 'mechanize'
domain = ''
email = ''
password = ''
deploy_domain = ''
deploy_server_id = ''
app_name = ''
new_domain = "{app_name}.welaika.com"
@sunny
sunny / paperclip_has_destroyable_file.rb
Created October 25, 2012 17:03
Rails Initializer to add destroyable attachments with Paperclip
# encoding: UTF-8
class ActiveRecord::Base
# Class method to add destroyable paperclip attachments.
#
# Example:
# has_attached_file :image
# has_destroyable_file :image
# attr_accessible :image_delete
#
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@endolith
endolith / Has weird right-to-left characters.txt
Last active October 26, 2024 13:55
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶