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
myApp.factory('dataThing',function($q,$http){ | |
var thatData = null; | |
return { | |
getData : function(){ | |
//create a promise | |
var deferredData = $q.defer() |
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
innitApp.provider('API',function(){ | |
//temp storage for new collection | |
var _collections = [] | |
//holds model references | |
var _models = {} | |
return { | |
//this fires when the provider is injected | |
$get : ['$resource',function($resource){ |
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
int samplesPerFrame = 32; | |
int numFrames = 48; | |
float shutterAngle = .8; | |
int[][] result; | |
float time; | |
void draw() { | |
for (int i=0; i<width*height; i++) | |
for (int a=0; a<3; a++) | |
result[i][a] = 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
import requestPermissions from './requestPermissions' | |
requestPermission(pickFromCamera, { | |
permissionNames: ['CAMERA', 'CAMERA_ROLL'], | |
alertTitle: '📷Camera📸', | |
alertBody: 'Use your camera now.', | |
}) | |
// Only request every n times this is run |
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
#### I18n | |
gem 'rails-i18n', '~> 4.0.0' | |
gem 'globalize' | |
gem 'rails_admin', github: 'sferik/rails_admin' | |
gem 'rails_admin_globalize_field' |
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
class DatabaseReport | |
def entry_counts | |
tables = table_model_names.map do |model_name| | |
entity = model_name.constantize rescue nil | |
next if entity.nil? | |
[entity.to_s, entity.count] | |
end.compact | |
total = tables.reduce(0) do |acc, curr| | |
puts "#{curr[0]}: #{curr[1]}" | |
acc + curr[1] |
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 jquery | |
//= require best_in_place | |
//= require jquery.purr | |
//= require active_admin/base | |
$(document).ready(function() { | |
$(".best_in_place").best_in_place() | |
$('.best_in_place').bind("ajax:success", function () {$(this).closest('tr').effect('highlight'); }); | |
$(document).on('best_in_place:error', function(event, request, error) { |
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
Copyright (c) 2011 ZURB, http://www.zurb.com/ |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
<!doctype html> | |
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
<html> | |
<head> | |
<title>iOS 8 web app</title> | |
<!-- CONFIGURATION --> |
OlderNewer