This file contains hidden or 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 Ember from 'ember'; | |
| import config from '../config/environment'; | |
| import fetch from 'ember-network/fetch'; | |
| const { Service, inject, RSVP } = Ember; | |
| export default Service.extend({ | |
| store: inject.service(), | |
| authenticationToken: undefined, | |
| currentUser: undefined, |
This file contains hidden or 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
| # SELECT company, | |
| # GREATEST(similarity(company.sourced_name, 'search term'), similarity(company.local_name, 'search term'), similarity(company.name, 'search term')) AS rank | |
| # FROM "companies" company | |
| # WHERE (similarity(company.sourced_name, 'search term') > 0.1::float) OR | |
| # (similarity(company.local_name, 'search term') > 0.1::float) OR | |
| # (similarity(company.name, 'search term') > 0.1::float) | |
| # ORDER BY rank DESC | |
| # LIMIT 5; | |
| defmodule Company do |
This file contains hidden or 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 IEx | |
| defmodule ByteReader do | |
| def read_2b(pid) do | |
| <<result::little-integer-size(16)>> = IO.binread(pid, 2) | |
| result | |
| end | |
| def read_4b(pid) do | |
| <<result::little-integer-size(32)>> = IO.binread(pid, 4) |
This file contains hidden or 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
| // LOCATION: frontend/tests/helpers/datetime-picker.js | |
| // I'll maybe refactor to add id selectors if there are two pickers | |
| // import and inject it to the ember-page-object property | |
| export default { | |
| fill(dateTime) { | |
| click('.cl-datetime-picker'); | |
| selectHour(dateTime.format('H')); | |
| selectMinute(dateTime.format('m')); | |
| selectMonth(dateTime.format('M')); |
This file contains hidden or 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 Ember from 'ember'; | |
| import { Serializer } from 'ember-cli-mirage'; | |
| const { isArray } = Ember; | |
| const { pluralize, underscore, dasherize } = Ember.String; | |
| export default Serializer.extend({ | |
| keyForAttribute: function(attr) { | |
| return underscore(attr); | |
| }, |
This file contains hidden or 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
| "13725 - Geth/v1.0.0/linux/go1.4.2" | |
| "5709 - Geth/v1.0.0/windows/go1.4.2" | |
| "5200 - Geth/LVIV/v1.0.0/linux/go1.4.2" | |
| "3950 - Geth/v1.0.0-0cdc7647/linux/go1.4" | |
| "3412 - Geth/v1.0.0-fc79d32d/linux/go1.4" | |
| "1122 - Bitcoin is THE Blockchain." | |
| "572 - Geth/v1.0.0-d7211dec/linux/go1.4" | |
| "505 - Geth/klosure/v1.0.0-fc79d32d/lin" | |
| "371 - Geth/v1.0.0/darwin/go1.4.2" | |
| "272 - NΞTHΞΒ" |
This file contains hidden or 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
| export default JSValueToCode; | |
| function JSObjectToCode(object) { | |
| if (Array.isArray(object)) { | |
| return '[' + object.map((element) => JSValueToCode(element)).join(', ') + ']'; | |
| } | |
| return '{' + Object.keys(object).reduce((result, key) => { | |
| const codeValue = JSValueToCode(object[key]); | |
| const pair = `'${key}': ${codeValue}`; |
This file contains hidden or 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('ember-metal-node'); | |
| require('ember-runtime-node'); | |
| const EmberObject = Ember.Object; | |
| const computed = Ember.computed; | |
| let me = EmberObject.create({ | |
| firstName: 'Izel', | |
| lastName: 'Nakri', | |
| fullName: computed('firstName', 'lastName', function() { |
This file contains hidden or 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 Izel do | |
| def nvim do | |
| System.cmd("tmux", ["new-window", "-n", "sketchpad", "nvim", "/Users/izelnakri/sketchpad.exs"]) | |
| trap_nvim_window_exit() | |
| end | |
| def trap_nvim_window_exit do | |
| case System.cmd("tmux", ["has-session", "-t", "main:sketchpad"], stderr_to_stdout: true) do | |
| {_, 0} -> | |
| Process.sleep(100) |