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 | |
echo "Installing Sublime text handler" | |
sudo cp sublime-handler /usr/local/bin | |
sudo cp sublime-handler.desktop /usr/share/applications/ | |
echo "Updating desktop database" | |
sudo update-desktop-database | |
cat <<THE_END | |
Not done yet! |
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 | |
#information | |
echo " | |
Popcorn-Time Beta 2 for Ubuntu-Linux | |
------------------------------------ | |
WARNING: Popcorn Time streams movies from Torrents. Downloading copyrighted material may be illegal in your country. Use at your own risk. | |
" | |
#verify awareness |
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 python | |
# filename <app>/ci_tool | |
# Zeus CI IDE | |
# Created by talos aka Giannis Tsagatakis | |
# --color | |
# --require spec_helper | |
# --format documentation | |
# --format html -o "tmp/rspec.html" |
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
rails g model user name:string avatar:attached | |
create_table :users do |t| | |
t.string :name | |
t.string :avatar_identifier | |
t.string :avatar_extension | |
t.integer :avatar_size | |
end | |
For more info look |
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 :tools do | |
desc 'Clear the database' | |
task :clear_db => :environment do |t,args| | |
ActiveRecord::Base.establish_connection | |
ActiveRecord::Base.connection.tables.each do |table| | |
next if table == 'schema_migrations' | |
ActiveRecord::Base.connection.execute("TRUNCATE #{table}") | |
end | |
end |
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
Rails I18n helper |
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
# | |
# Bash completion file for Linux Mint apt utility. | |
# | |
have apt && | |
_apt() | |
{ | |
local cur opt | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" |
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 | |
# https://github.com/ryanries/UniversalPauseButton | |
# https://news.ycombinator.com/item?id=9686854 | |
currentProcess=$(xprop -id $(xprop -root | grep -F '_NET_ACTIVE_WINDOW(WINDOW)' | awk '{print $5}') | grep -F '_NET_WM_PID(CARDINAL)' | awk '{print $3}') | |
state=$(grep 'State:' /proc/$currentProcess/status | awk '{print $2}') | |
if [[ "$state" == "T" ]] | |
then |
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 'htmlentities' | |
require 'i18n/backend/active_record' | |
module I18n | |
module Backend | |
require 'i18n/core_ext/object/meta_class' | |
# Just to enhance the I18n. | |
module JustALoader | |
include Metadata |
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
module TranslationHelper | |
# foo = ActionView::Base.new.extend TranslationHelper | |
# TODO: If translation is missing | |
# get a translation from google | |
# and then add it to database, marked as dirty (how?) | |
def translate(key, options = {}) | |
key = scope_key_by_partial(key) | |
options[:raise] = true | |
options[:request_locale] = options.has_key?(:locale) ? options[:locale] : I18n.locale |
OlderNewer