Skip to content

Instantly share code, notes, and snippets.

@JPvRiel
JPvRiel / apt_pinning_priorities.md
Last active July 5, 2024 17:46
Apt package pinning and priorities
@1zaman
1zaman / ResultHolder.java
Last active December 18, 2018 18:23
Loader for Retrofit 2.0 API. This uses the framework implementation, but it can be adapted to use the support library implementation without much modification.
package com.example.retrofit.loader;
import retrofit.Response;
/**
* A wrapper around the Retrofit {@link Response} that will
* throw any loading errors upon retrieval.
*
* @param <T> The data type that was loaded.
*/

YARD CHEATSHEET http://yardoc.org

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

# Namespace for classes and modules that handle serving documentation over HTTP
# @since 0.6.0
@Pysis868
Pysis868 / grub.cfg
Last active May 29, 2024 20:27
My own configuration file for GRUB2 to boot various live distributions of Linux-based operating systems, along with some system tools. I tried to include a lot of sample configuration entries, even if I don't currently use them, so it may help others. Exceedingly long blog post: http://tehfishyblog.logdown.com/chips/306146-a-homemade-ultimate-bo…
# Config for GNU GRand Unified Bootloader (GRUB) (2)
# /boot/grub2/grub.cfg
# or
# /boot/grub/grub.cfg
# Mostly only 'legacy' CSM/BIOS boot methods currently.
# Unable to boot loop entries with Secure Boot
# Notes:
# Description:
# This grub.cfg file was created by Lance http://www.pendrivelinux.com
@dchandekstark
dchandekstark / unconcerned.rb
Last active March 10, 2016 00:59
Unconcerned
ActiveSupport::Concern.module_eval do
WARNINGS = [
"Are you sure you want to this?",
"Come on, now, really?",
"Time to refactor?",
"Read http://blog.coreyhaines.com/2012/12/why-i-dont-use-activesupportconcern.html ?",
"Please don't do this without a good reason.",
"No, chunking your mega-class is not a good reason.",
"What objects are you trying to hide?",
@pazdera
pazdera / yardoc-cheatsheet.rb
Last active November 5, 2016 02:35
Basic Yard Syntax (contributions welcome)
# Quick summary of the function
#
# {ObjectName#method Optional Title}
# {Class::CONSTANT Optional Title}
# {#method_inside_current_namespace}
#
# @see #method
#
# @param one [Fixnum] First parameter
# @param two [Fixnum] Second parameter
@leompeters
leompeters / .belanton_rubymine_livetemplates
Last active March 7, 2019 20:18
RubyMine Live Templates for commented items at Belanton Team.
You can use these settings on your RubyMine [http://rubymine.org]. Here are some RubyMine Live Templates.
@mttdffy
mttdffy / unvalidate.rb
Last active November 17, 2017 19:59
RoR/Mongoid module for removing validations from a model
module Mongoid
module Unvalidate
extend ActiveSupport::Concern
module ClassMethods
# Removes specified validations from existing models for a given field
#
# @param [Symbol] field the field to remove validations from
# @param [Array<Symbol> | Symbol] validations validations to remove from field
@mttdffy
mttdffy / jquery_ui.rb
Last active April 24, 2017 13:18
Capybara / Poltergeist helpers for JQuery UI
module JSHelpers
module JQueryUI
# type inside an autocomplete field and pick a value.
#
# @param [String] field selector of the autocomplete field
# @param [Hash] options details about what to search and what to select
# @param options [String] :with the text to type in the autocomplete field
# @param options [String] :select the text value of the autocomplete resuilt you
# want to pick. If this option is not present, the first result will be picked.