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
# Total number of users from last month | |
User.where(last_sign_in_at: 1.month.ago..Date.today).count | |
User.where(last_sign_in_at: 1.month.ago..Date.today).order(:last_sign_in_at).pluck(:email, :last_sign_in_at) | |
# Number of users who updated at least one experiment in the last month | |
Experiment.joins(:user).where(updated_at: 1.month.ago..Date.today).order(:updated_at).pluck(:updated_at, :id, :title, 'users.email').uniq {|r| r.last}.count | |
Experiment.joins(:user).where(updated_at: 1.month.ago..Date.today).order(:updated_at).pluck(:updated_at, :id, :title, 'users.email').uniq {|r| r.last} | |
Experiment.joins(:user).where(updated_at: 1.month.ago..Date.today).order(:updated_at).pluck(:updated_at, :id, :title, 'users.email').uniq {|r| r.last}.map {|a| {a.first.strftime("%b-%Y") => { experiment_title: a[2], user_email: a.last } }} | |
# Number of experiments,grouped by users, created per month for the past 18 months |
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 ./libs/jquery-1.9.1 | |
#= require modernizr-2.0 | |
#= require ender | |
#= require jquery.waitforimages | |
#= require fancybox/jquery.mousewheel-3.0.6.pack | |
#= require fancybox/jquery.fancybox.pack | |
#= require underscore | |
#= require twitter | |
#= require gallery | |
#= require ./libs/lunr.min |
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
BASE_DIR = 'source/_assets/images/galleries' | |
module ImageList | |
def image_list( name ) | |
list = Array.new | |
dir = Dir.new( File.join(BASE_DIR, name) ) | |
dir.each do | d | | |
image = File.basename(d, File.extname(d)) | |
unless d =~ /^\./ || d =~ /thumbs/ | |
list << ["/images/galleries/#{name}/#{d}", "#{name}", "#{image}", "/images/galleries/#{name}/thumbs/#{d}"] |
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
# go to facebook explorer api and get a token, be sure to add user_posts to the app permission!!! | |
graph_api = Koala::Facebook::API.new("your token in here") | |
graph_api.get_connections("me", "posts", { limit: 200 } ) |
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 'minitest/autorun' | |
require_relative 'anagram' | |
class AnagramTest < MiniTest::Unit::TestCase | |
def test_no_matches | |
detector = Anagram.new('diaper') | |
assert_equal [], detector.match(%w(hello world zombies pants)) | |
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
defmodule Twitter do | |
def get_oauth_token | |
consumer_key= "yourkey" | |
consumer_secret = "yoursecret" | |
url = 'https://api.twitter.com/oauth' | |
consumer = Oauthex.Consumer.new( | |
key: :erlang.binary_to_list(consumer_key), | |
secret: :erlang.binary_to_list(consumer_secret) |
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
let g:ScreenImpl = 'Tmux' | |
let g:ScreenShellTmuxInitArgs = '-2' | |
let g:ScreenShellInitialFocus = 'shell' | |
let g:ScreenShellQuitOnVimExit = 0 |
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
" Screen settings | |
map <F5> :ScreenShellVertical<CR> | |
command! -nargs=? -complete=shellcmd W :w | :call ScreenShellSend("load '".@%."';") | |
map <Leader>c :ScreenShellVertical bundle exec rails c<CR> | |
map <Leader>r :w<CR> :call ScreenShellSend("rspec ".@% . ':' . line('.'))<CR> | |
map <Leader>e :w<CR> :call ScreenShellSend("cucumber --format=pretty ".@% . ':' . line('.'))<CR> | |
map <Leader>b :w<CR> :call ScreenShellSend("break ".@% . ':' . line('.'))<CR> |
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
# Generating Site with Jekyll | |
WARNING: 'noise.png %}' was not found (or cannot be read) in /Users/yortz/code/projects/website.com/source/_assets/images/{% asset_path images | |
File not found or cannot be read: /Users/yortz/code/projects/website.com/source/_assets/images/{% asset_path images/straight-border.png %} | |
Configuration from /Users/yortz/code/projects/website.com/_config.yml | |
Building site: source -> public | |
Successfully generated site: source -> public |
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
$noise-bg: image-url("{% asset_path images/noise.png %}") top left !default; | |
$img-border: inline-image("{% asset_path images/straight-border.png %}"); | |
// Main Link Colors | |
$link-color: #e11e30 !default; | |
$link-color-hover: adjust-color($link-color, $lightness: 20, $saturation: 45) !default; | |
$link-color-visited: adjust-color($link-color, $hue: 80, $lightness: -4) !default; | |
$link-color-active: adjust-color($link-color-hover, $lightness: -15) !default; | |
// Main Section Colors |
NewerOlder