Skip to content

Instantly share code, notes, and snippets.

View killerbytes's full-sized avatar

Joel Carlos killerbytes

  • SMILEUPPS-EEAA4883DF
  • SMILEUPPS-EEAA4883DF
View GitHub Profile
@killerbytes
killerbytes / downloadFile.js
Created December 26, 2020 07:55 — forked from davalapar/downloadFile.js
Download response.data as a file, through Blob()
// 'downloadFile.js', written by blending two solutions:
// 'js-download' https://github.com/kennethjiang/js-file-download
// 'Anders Paulsen' https://blog.jayway.com/2017/07/13/open-pdf-downloaded-api-javascript/
export function downloadFile(data, filename, mime) {
// It is necessary to create a new blob object with mime-type explicitly set
// otherwise only Chrome works like it should
const blob = new Blob([data], {type: mime || 'application/octet-stream'});
if (typeof window.navigator.msSaveBlob !== 'undefined') {
// IE doesn't allow using a blob object directly as link href.
@killerbytes
killerbytes / github_multiple-accounts.md
Created August 1, 2019 04:43 — forked from JoaquimLey/github_multiple-accounts.md
How to Work with GitHub and Multiple Accounts

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"

Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.

Step 2 - Attach the New Key

import Ember from 'ember';
import DS from 'ember-data';
/**
* Returns true iff the number passed in is even
* @param {Number} x
* @return {Boolean}
*/
function isEven(x) {
return x % 2 == 0;
@killerbytes
killerbytes / gist:3485284
Created August 27, 2012 03:30 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@killerbytes
killerbytes / reset.css
Created June 15, 2012 04:08 — forked from terkel/reset.css
CSS: Reset
/*!
* CSS Reset 2011-12-25
* https://gist.github.com/gists/1360380
*
* Author: Takeru Suzuki, http://terkel.jp/
* License: Public domain
*
* Inspired by Normalize.css: http://necolas.github.com/normalize.css/
*/