Skip to content

Instantly share code, notes, and snippets.

View timfjord's full-sized avatar
🐇

Tim Masliuchenko timfjord

🐇
  • RingCentral
  • UK
View GitHub Profile
@timfjord
timfjord / url_generation_with_benchmark_test.rb
Last active April 12, 2018 07:57
url_generation_test.rb with benchmark
# frozen_string_literal: true
require "abstract_unit"
module TestUrlGeneration
class WithMountPoint < ActionDispatch::IntegrationTest
Routes = ActionDispatch::Routing::RouteSet.new
include Routes.url_helpers
class ::MyRouteGeneratingController < ActionController::Base
<html ng-app="Demo">
<head metang-head>
<title metang="prefix">My Site</title>
<meta name="description" content="Desc of my website" metang>
</head>
<body ng-controller="TestCtrl">
</body>
</html>
@timfjord
timfjord / facebook-connect-plugin.js
Last active August 29, 2015 14:27
facebook-connect-plugin for ionic
"use strict";
/*
* @author Ally Ogilvie
* @copyright Wizcorp Inc. [ Incorporated Wizards ] 2014
* @file - facebookConnectPlugin.js
* @about - JavaScript interface for PhoneGap bridge to Facebook Connect SDK
*
*
*/
def total_by(obj, date)
if obj.is_a? String
group_by = obj
filter_by = false
else
filter_by = obj.class.model_name
group_by = opposite_association(name).to_s
end
query = scoped.where(date: date.beginning_of_month..date.end_of_month)
module HelperMacros
extend ActiveSupport::Concern
module ClassMethods
# Use before test block 'it'
# create global object user and sign in
#
def sign_in(who=:user)
@timfjord
timfjord / br.js
Created October 31, 2012 11:01 — forked from anonymous/br.js
Basecamp report
var result = {}; $$('.entry').each(function(item) { var key = item.down('.date a').innerHTML; value = parseFloat(item.down('.hours').innerHTML); if (result[key]) { result[key]+= value; } else { result[key] = value; } }); console.log(result);
@timfjord
timfjord / .zshrc
Created October 14, 2012 12:27
zsh configufation
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Set to this to use case-sensitive completion
@timfjord
timfjord / mybeautystore.user.js
Created October 7, 2012 10:30
Mybeautystore Photo Grabber
// ==UserScript==
// @name Mybeautystore Photo Grabber
// @namespace MybeautystorePhotoGrabber
// @author Tima Maslychenko
// @description Script that show big picture on product page
// @match http://www.mybeautystore.de/*/*.html
// @version 0.1
// ==/UserScript==
// a function that loads jQuery and calls a callback function when jQuery has finished loading