This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :my_app do | |
desc "Display all models" | |
task models: :environment do |t| | |
puts 'Tabelas existentes:', "" | |
ActiveRecord::Base.connection.tables.delete_if do |table| | |
table.include? 'schema' | |
end.each do |table| | |
puts "<<<< #{table} >>>>" | |
ActiveRecord::Base.connection.columns(table).each do |column| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
ruby '2.3.0' | |
gem 'rails', '4.2.6' | |
gem 'rake', '~> 11.1.2' | |
gem 'pg' | |
gem 'kaminari', '~> 0.16.3' | |
gem 'ransack', '~> 1.7.0' | |
gem 'devise', '~> 3.5.3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#if defined(__linux__) || defined(__linux) | |
#define LINUX | |
#endif | |
#if defined(__WIN32__) || defined(__NT__) | |
#define WINDOWS | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat /etc/lsb-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
public class ${1:${TM_FILENAME/(.+)\..+|.*/$1/:name}} { | |
public static void main(String[] args) { | |
${2} | |
} | |
} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>clm</tabTrigger> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'open_uri_redirections' | |
require 'nokogiri' | |
require 'pry' | |
LINKS_FILE = 'links.txt' | |
BASE_URL = 'http://www.animakai.tv' | |
NAMESPACE = 'anime/1877' | |
VIDEOS_DIRECTORY = 'videos' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'colorize' | |
files_with_debug = `git diff --name-only --cached | xargs grep -EH '^[^#]*binding.pry' | cut -d':' -f 1` | |
unless files_with_debug&.strip&.empty? | |
puts 'Tem código de debug nos seguintes arquivos:' | |
puts files_with_debug | |
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'pry' | |
def fetch(uri_str, limit = 30) | |
# You should choose a better exception. | |
raise ArgumentError, 'too many HTTP redirects' if limit == 0 | |
uri = URI(uri_str) | |
use_ssl = uri.scheme == 'https' ? true : false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import glob | |
import os | |
import random | |
import time | |
PICTURES_PATH = os.path.join(os.path.expanduser("~"), "Pictures") | |
WALLPAPERS_PATH = os.path.join(PICTURES_PATH, "Wallpapers") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
module ChangeWallpaper | |
HOME = ENV['HOME'] | |
PICTURES_PATH = HOME + '/Pictures' | |
WALLPAPERS_PATH = PICTURES_PATH + '/Wallpapers' | |
def self.change | |
wallpaper = Dir.glob("#{WALLPAPERS_PATH}/**/*").sample | |
command = "gsettings set org.gnome.desktop.background picture-uri #{wallpaper}" |
OlderNewer