Skip to content

Instantly share code, notes, and snippets.

@softwhisper
softwhisper / EmptyRecyclerView.java
Created June 29, 2016 11:26 — forked from meoyawn/EmptyRecyclerView.java
RecyclerView doesn't have an emptyView support, we gotta fix that
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class EmptyRecyclerView extends RecyclerView {
@Nullable View emptyView;
@softwhisper
softwhisper / clean_description.rake
Created March 19, 2012 09:15 — forked from andresgutgon/clean_description.rake
Limpiar TextArea en Rails 3
require File.expand_path(File.dirname(__FILE__) + "/../sanitize_tinymce_text")
include SanitizeTinymceText
namespace :html do
desc "Limpiar descripciones guarrillas con css inline y spans"
task :clean => :environment do
Publication.all.each do |pub|
pub.abstract = sanitize_text(pub.abstract)
pub.save
@softwhisper
softwhisper / cap_system_folder.rb
Created March 12, 2012 15:47
Capistrano receipt: Download system folder of a Rails app to tmp
namespace :system_folder do
desc "Download System Folder"
task :sync do
get "#{shared_path}/system/", "tmp/", :recursive => true
end
end
@softwhisper
softwhisper / cap_system_status.rb
Created March 11, 2012 16:17
Capistrano receipt for general system status
namespace :status do
desc "Displays memory usage"
task :memory do
mem = capture("free -m | grep Mem").squeeze(" ").split(" ")[1..-1]
total, used, free, shared, buffers, cached = mem
puts "\nMemory in (MBs)"
puts "----------------------------"
puts "Total: #{total}"
puts "Used: #{used}"