Skip to content

Instantly share code, notes, and snippets.

View mopx's full-sized avatar

Jorge Yau mopx

View GitHub Profile
@mopx
mopx / build.gradle
Created December 10, 2017 23:43
Add this to android/build.gradle to override the compiled and build version on every react native component
// override build.gradle on every js module.
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
}
}
}
0xd7a4B209E43dfd96C935Fe07f9Bd82b12A5CeD96
@mopx
mopx / WPML Date Translation
Created August 20, 2014 20:15
Add this to your functions.php file
add_filter('option_date_format', 'translate_date_format');
function translate_date_format($format) {
if (function_exists('icl_translate'))
$format = icl_translate('Formats', $format, $format);
return $format;
}
<div class="language-selector">
<ul>
<?php
$languages = icl_get_languages('skip_missing=0&orderby=code&order=asc');
foreach ($languages as &$lang) {
$class = ($lang['active'] == 1) ? "active" : "";
echo '<li><a href="' . $lang['url'] . '" class="' . $class . '" title="' . $lang['native_name'] . '">' . $lang['language_code'] . '</a></li>';
}
?>
</ul>
@mopx
mopx / 01. Gemfile
Created July 8, 2012 20:26 — forked from schleg/01. Gemfile
Setup for Devise + Omniauth
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'
@mopx
mopx / redmine_heroku_deploy.sh
Created September 30, 2011 18:20
Deploy Redmine to Heroku
#!/bin/bash
set -e
REDMINE_URL="http://rubyforge.org/frs/download.php/75097/redmine-1.2.1.tar.gz"
S3_ACCESS_KEY_ID=""
S3_SECRET_ACCESS_KEY=""
S3_BUCKET_NAME=""
HEROKU_APP_NAME=""
@mopx
mopx / Rails 3 Environment
Created May 1, 2011 00:37 — forked from laserlemon/Rails 3 Environment
Snow Leopard, Homebrew, Git, RVM, Ruby, Rails, Passenger, Apache, MySQL, Memcached and ImageMagick
# 2010-10-01
#
# Mac OS X 10.6.3
# Homebrew 0.7
# Xcode 3.2.4
# Git 1.7.3.1
# RVM 1.0.12
# Ruby 1.9.2, 1.8.7
# Rails 3.0.0
# Passenger 3.0.0.pre4
@mopx
mopx / deploy.rb
Created April 8, 2011 00:00 — forked from andruby/deploy.rb
after "deploy:symlink", "deploy:restart_workers"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}"
button {
display: block;
min-width: 99px;
background: #fff url(/images/btn-shader.png) 0 100% repeat-x;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
border: 1px solid #b4b4b4;
border-top-color: #d4d4d4;
border-left-color: #d4d4d4;
for i in *; do if [ -d "$i" ]; then tar czf /archive/"$i".tar.gz "$i"; fi; done