Skip to content

Instantly share code, notes, and snippets.

View iirving's full-sized avatar
💭
Looking for the next Thing

Ian irving iirving

💭
Looking for the next Thing
View GitHub Profile
@iirving
iirving / uploadBinaryToFireBaseStorage.js
Last active April 23, 2024 12:18
Upload a file binary to firebase storage
// using LTS version of node v20.x, and the firebase-admin version 12.0.0
import { initializeApp, applicationDefault } from "firebase-admin/app";
import { getStorage } from "firebase-admin/storage";
/***
* Upload a file binary to firebase storage
* @param {Buffer} fileBinary - the buffer of the file to upload
* @param {string} fileNameForUpload - the name of the file after upload
* @returns {object} - {status: string, msg: string, error: string}
*/
@iirving
iirving / Vue VS Code Profile
Last active November 12, 2023 18:51
A VS Code profile for Vue.JS development, based on the Node profile. should be able to import into your VSCode ide
{"name":"Vue","icon":"telescope","settings":"{\"settings\":\"{\\n \\\"editor.formatOnPaste\\\": true,\\n \\\"git.autofetch\\\": true,\\n \\\"[markdown]\\\": {\\n \\\"editor.wordWrap\\\": \\\"on\\\"\\n },\\n \\\"[json]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"[jsonc]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"vscode.json-language-features\\\"\\n },\\n \\\"[html]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"[javascript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"[typescript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"joplin.token\\\": \\\"905ddba489c3006cc556da45674eafa17136707f623f49ef5576e90349aa7087eb20b3a8a6f66d506f648b9b6844452f627d2ed1d288f1be436492bc7e96ae76\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"eslint.useESLintClass\\\": tr
@iirving
iirving / ..git-pr.md
Created February 23, 2021 19:09 — forked from gnarf/..git-pr.md
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
import Ember from 'ember';
export default Ember.Controller.extend({
intl: Ember.inject.service(),
appName: 'Ember Twiddle',
price: 232323,
enterPrice: Ember.computed('intl.locale', 'price', function() {
console.log(this.get('intl').formatNumber(this.get('price'), { currency: 'USD', format: 'USD', style: 'currency' }));
return this.get('intl').formatNumber(this.get('price'), {
currency: 'USD',
@iirving
iirving / components.display-list.js
Last active July 31, 2017 16:14
ember filter a list
import Ember from 'ember';
export default Ember.Component.extend({
activeList: Ember.computed.filterBy('list','status', 'active'),
newList: Ember.computed.filter('list', function(item) {
return item.status === this.get('status')
})
});
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'section',
classNames: [ 'i18n-demo' ],
i18n: Ember.inject.service(),
beenClicked: false,
text: Ember.computed('i18n.locale', function()
{
@iirving
iirving / controllers.application.js
Created August 30, 2016 21:16
ember-paper-button-issue
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
url: "http://www.google.com"
});
@iirving
iirving / components.limit-each.js
Last active August 4, 2016 02:16 — forked from Serabe/components.limit-each.js
Limit with init
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super(...arguments);
const showOnly = this.get('showOnly');
console.log('showOnly', showOnly);
if (showOnly && Number.isInteger( parseInt(showOnly))) {
this.set('people', this.get('people').slice(0, parseInt(showOnly)));
}
@iirving
iirving / app.js
Created April 19, 2016 19:37
save with Arrays
import Ember from 'ember';
const students = ['Erick', 'Jim', 'Ducky', 'Lee'];
students.forEach(function(item, index) {
console.log(`student #${index+1} : ${item} `);
});
//upper
const upperCaseStudent = students.map(function(item) {
@iirving
iirving / app.js
Created April 19, 2016 18:51
bindings
import Ember from 'ember';
//import Resolver from 'ember/resolver';
//import loadInitializers from 'ember/load-initializers';
import config from './config/environment';
import teacher from './teacher';
import student from './student';
import myName from './myName';
import user from './user';