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
# hack to rvm invoke .rvmrc | |
cd_with_pushd() | |
{ | |
if [ $# -eq 0 ]; then | |
DIR="${HOME}" | |
else | |
DIR="$1" | |
fi | |
pushd "${DIR}" |
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
filenames = Dir.glob(Rails.application.paths.app.models.collect { |path| File.join(path, "**/*.rb") }) | |
$class_names = [] | |
filenames.each do |filename| | |
$class_names += File.read(filename).scan(/class ([\w\d_\-:]+)/).flatten | |
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
# app/views/layouts/application.html.erb | |
<% head_style 'styles' %> | |
<% head_javascript 'application' %> | |
<%= render :file => 'layouts/rails_admin/main' %> |
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
if (localStorage.getItem("dbCreated") != true) { | |
html5sql.openDatabase("ScratchDB", "Scratch DB", 3 * 1024 * 1024); | |
var request = new XMLHttpRequest(); | |
request.open("GET", "file:///android_asset/www/create.sql", true); | |
request.onreadystatechange = function(){ | |
if (request.readyState == 4) { | |
if (request.status == 200 || request.status == 0) { | |
html5sql.process(request.responseText, | |
function(){ | |
console.log("Win!"); |
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 'rubygems' | |
require 'sinatra' | |
require 'pony' | |
require 'haml' | |
set :haml, {:format => :html5} | |
set :public, File.dirname(__FILE__) | |
set :views, File.dirname(__FILE__) | |
# Create the page class and give it a title of Contact for the layout |
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
// Load plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), | |
rename = require('gulp-rename'), | |
notify = require('gulp-notify'), | |
concat = require('gulp-concat'), | |
uglify = require('gulp-uglify'), | |
markdown = require('gulp-markdown'), |
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
var visible = document.querySelectorAll('.element'); | |
function isInViewport(el) { | |
var rect = el.getBoundingClientRect(); | |
return ( | |
// when any part of element is visible | |
rect.top >= -el.clientHeight && | |
rect.left >= -el.clientWidth && | |
rect.bottom <= window.innerHeight + el.clientHeight && | |
rect.right <= window.innerWidth + el.clientWidth |
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
## | |
# CarrierWave Amazon S3 File Reprocessor Rake Task | |
# | |
# Written (specifically) for: | |
# - CarrierWave | |
# - Ruby on Rails 3 | |
# - Amazon S3 | |
# | |
# Works with: | |
# - Any server of which you have write-permissions in the Rails.root/tmp directory |
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
<?php | |
/** | |
* This code is intended to be added to your wp-config.php file just below the top comment block. | |
* It should replace the existing define('DB_*') statements. You can add or remove sections | |
* depending on the number of environments you intend to setup. You should change all values of | |
* DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST for each environment, making them all distinct | |
* for security purposes. | |
*/ | |
// determine the current environment |
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
-- as superuser: | |
CREATE EXTENSION pg_cron; | |
GRANT USAGE ON SCHEMA cron TO citus; | |
CREATE SCHEMA partman; | |
GRANT USAGE ON SCHEMA partman TO citus; | |
CREATE EXTENSION pg_partman WITH SCHEMA partman; | |
GRANT ALL ON TABLE partman.part_config TO citus; | |
GRANT ALL ON TABLE partman.part_config_sub TO citus; |
OlderNewer