Skip to content

Instantly share code, notes, and snippets.

View frankyston's full-sized avatar
🎯
Ruby on Rails is Fun

Frankyston Lins frankyston

🎯
Ruby on Rails is Fun
View GitHub Profile
INSERT INTO `your_db`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('5', 'admin', MD5('password'), 'admin', '[email protected]', 'http://www.yoursite.com', '2011-06-15 00:00:00', '', '0', 'Admin');
INSERT INTO `your_db`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '5', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
INSERT INTO `your_db`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '5', 'wp_user_level', '10');
UPDATE wp_options
SET option_value = REPLACE(option_value, 'http://localhost', 'http://www.seudomino.com')
WHERE option_name = 'home'
OR option_name = 'siteurl';
UPDATE wp_posts
SET guid = REPLACE (guid, 'http://localhost', 'http://www.seudomino.com');
UPDATE wp_posts
SET post_content = REPLACE (post_content, 'http://localhost', 'http://www.seudomino.com');
cd /path/to/your/repo
curl https://gist.github.com/ssaunier/8704755/raw/pre-push.sh > .git/hooks/pre-push
chmod u+x .git/hooks/pre-push
@frankyston
frankyston / universidades.csv
Last active September 3, 2015 17:42 — forked from alexandremcosta/universidades.csv
Lista de Todas as Universidades do Brasil (retirado do portal de indicadores do INEP/ENADE)
ACADEMIA DA FORÇA AÉREA AFA SP
ACADEMIA DA POLÍCIA CIVIL DO ESTADO DA BAHIA ACADEPOL BA
ACADEMIA DE POLÍCIA MILITAR DO BARRO BRANCO APMBB SP
ACADEMIA DE POLÍCIA MILITAR DOM JOÃO VI APMDJVI RJ
ACADEMIA DE POLÍCIA MILITAR APM BA
ACADEMIA MILITAR DE AGULHAS NEGRAS AMAN RJ
ANHANGUERA EDUCACIONAL S.A. UNIANHANGUERA RS
ANHANGUERA EDUCACIONAL AESA SP
ASSOCIAÇÃO CATARINENSE DE ENSINO ACE SC
ASSOCIAÇÃO DE ENSINO SUPERIOR DO PIAUÍ AESPI PI
@frankyston
frankyston / _flash_messages.html.erb
Created October 3, 2015 16:46 — forked from roberto/_flash_messages.html.erb
Rails flash messages using Twitter Bootstrap
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@frankyston
frankyston / mp32ogg.rb
Created October 24, 2015 15:45 — forked from ideaoforder/mp32ogg.rb
Ruby script to convert dir of mp3s to oggs
#!/usr/bin/env ruby
require 'rubygems'
@dir = ARGV[0]
@i = 0
Dir.glob("#{@dir}/*.mp3").each do |mp3|
ogg = mp3.gsub('mp3', 'ogg')
system "ffmpeg -i \"#{mp3}\" -acodec libvorbis -ac 2 \"#{ogg}\""
@i += 1
end
@frankyston
frankyston / Rails: SendGrid initializer
Last active May 4, 2016 20:13 — forked from ushu/Rails: SendGrid initializer
Rails: SendGrid settings
# config/initializers/sendgrid.rb
ActionMailer::Base.smtp_settings = {
:user_name => ENV['SENDGRID_USER'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'herokuapp.com',
:address => 'smtp.sendgrid.net',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true
}
@frankyston
frankyston / remodelagem-para-mongodb.md
Created December 7, 2015 22:01 — forked from suissa/remodelagem-para-mongodb.md
Um aluno do Be MEAN postou essa modelagem relacional a qual ele estava com dificuldades para passar para o MongoDB, então vou ensinar aqui como faz

Remodelagem do Relacional para o MongoDb

Um aluno do Be MEAN postou essa modelagem relacional a qual ele estava com dificuldades para passar para o MongoDB, então vou ensinar aqui como faz

Vamos inicialmente separar pelas COLEÇÕES que achamos que devemos ter:

  • Usuario;
  • Escola;
@frankyston
frankyston / _form.html.erb
Created December 15, 2015 10:38 — forked from kouheiszk/_form.html.erb
simple_form.rb for semantic ui
<%= f.input :email,
wrapper: :semantic_icon_input,
label: false,
required: true,
placeholder: t('users.form.placeholder.email'),
left_icon: 'user' %>
@frankyston
frankyston / ionic.popup.material.scss
Created December 24, 2015 15:34 — forked from alancpazetto/ionic.popup.material.scss
Ionic Framework Popup Material Design (SCSS)
$buttonsColor : #2196f3;
.popup-container{
.popup{
padding-top: 5px;
padding-left: 10px;
background: #fafafa;
-webkit-box-shadow: 0 10px 30px 0 rgba(0,0,0,.3);
box-shadow: 0 10px 30px 0 rgba(0,0,0,.3);