Skip to content

Instantly share code, notes, and snippets.

:root{
--ss-primary-color: #5897fb;
--ss-bg-color: #ffffff;
--ss-font-color: #4d4d4d;
--ss-font-placeholder-color: #8d8d8d;
--ss-disabled-color: #dcdee2;
--ss-border-color: #dcdee2;
--ss-highlight-color: #fffb8c;
--ss-success-color: #00b755;
--ss-error-color: #dc3545;
@sevab
sevab / relative_time.po
Last active September 12, 2022 22:06
my_app/priv/gettext/en_abbrev/LC_MESSAGES/relative_time.po
# `msgid`s in this file come from POT (.pot) files.
#
# Do not add, change, or remove `msgid`s manually here as
# they're tied to the ones in the corresponding POT file
# (with the same domain).
#
# Use `mix gettext.extract --merge` or `mix gettext.merge`
# to merge POT files into PO files.
msgid ""
msgstr ""
@sevab
sevab / affiliate.js
Created October 29, 2020 23:49
Amazon Affiliate Link Bookmark Generator
javascript:(function(){ var aff = 'campusboard0e-21'; if (!document.getElementById('ASIN')) { alert('Could not find the product ID.'); return; } var asin = document.getElementById('ASIN').value; prompt( 'Here is your link:', 'http://www.amazon.co.uk/dp/' + asin + '/?tag=' + aff); })()
@sevab
sevab / controllers.application.js
Last active December 19, 2019 13:44
redirect-twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
queryParams: [ 'utm_medium' ], // omit utm_source on purpose
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@sevab
sevab / service_analyzer.rb
Last active May 18, 2018 11:05
Emebr Services Feature Analyzer
services_dir_name = './app/services'
servise_dir = Dir.glob(File.join(services_dir_name, '**', '*'))
object_proxy_tests = [/ObjectProxy/, /_ProxyMixin/]
service_inject_tests = [/inject as service/]
alias_tests = [/alias/]
readonly_tests = [/readonly/]
observer_tests = [/observer/]
actions_tests = [/actions/]
exrtended_mixin_tests = [/EventedMixin/]
@sevab
sevab / to-relative-time.js
Last active January 24, 2016 04:14
Express past and future dates in relative words in JavaScript
/**
* A lighter version based on https://github.com/jherdman/javascript-relative-time-helpers
*
* Takes a date either in the future or the past and returns distance of time in words from that date up to now
*
* Examples:
*
* - current date:
* toRelativeTime(new Date())
* > 'Just now'
class Board
def initialize ships
@ships = ships
end
def shoot coordinates
if coordinates == 1 # this would call the ships really
@ships = [0,0,-1,1]
return 'HIT'
end