Skip to content

Instantly share code, notes, and snippets.

Avatar

Vinícius Sales viniciussbs

View GitHub Profile
@viniciussbs
viniciussbs / controllers.application\.js
Created May 24, 2020
each-in and tracked properties
View controllers.application\.js
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
class Me {
tired = null
hungry = null
constructor(me) {
this.tired = me.tired;
View apollo-cache-shoebox.ts
import ApplicationInstance from '@ember/application/instance';
export function initialize(appInstance: ApplicationInstance): void {
const fastboot = appInstance.lookup('service:fastboot');
const apolloCache = appInstance.lookup('service:apollo').client.cache;
const shoebox = fastboot.get('shoebox');
if (fastboot.get('isFastBoot')) {
shoebox.put('apollo-cache', {
get cache(): unknown {
@viniciussbs
viniciussbs / ember-cli-build.js
Created Apr 6, 2020 — forked from vasind/ember-cli-build.js
Ember CLI performance improvements and tips
View ember-cli-build.js
// Credits to the following posts that helps me to reduce build times drastically
// https://discuss.emberjs.com/t/tips-for-improving-build-time-of-large-apps/15008/12
// https://www.gokatz.me/blog/how-we-cut-down-our-ember-build-time/
//ember-cli-build.js
let EmberApp = require('ember-cli/lib/broccoli/ember-app');
let env = EmberApp.env(),
@viniciussbs
viniciussbs / README.md
Created Nov 9, 2019 — forked from oznu/README.md
How to Bootcamp / Dual Boot Windows 10 on a mid-2011 iMac using USB
View README.md

How to Install / Bootcamp Windows 10 on a mid-2011 iMac using USB

Apple has released support for bootcamping Windows 10, but only on 2012 Macs and later. Despite not being supported. it is possible to install Windows 10 on earlier iMacs and it seems to run quite well.

IMPORTANT: Unplug all external and physical hard drives (where possible) that you won't be installing to to avoid accidentally erasing them. Also make note of which drives and partitions remain (e.g. System and Storage hard drives), and be super careful to not erase the wrong one.

RECOVERY: If you nuke your machine, restore your time machine backup. Instructions here.

Requirements

@viniciussbs
viniciussbs / adauth.rb
Created Oct 20, 2018 — forked from boopathi/adauth.rb
Ruby AD Authentication
View adauth.rb
# Usage:
# user = ActiveDirectoryUser.authenticate('boopathi','password')
# user.first_name # => "Boopathi"
# user.flanderized_first_name # => "Boopathi Rajaa"
# user.groups # => ["Mac Users", "Geeks", "Ruby Coders", ... ]
require 'net/ldap' # gem install ruby-net-ldap
class ActiveDirectoryUser
### BEGIN CONFIGURATION ###
@viniciussbs
viniciussbs / README.md
Created Dec 8, 2017 — forked from rbishop/README.md
A super simple Elixir server for sending Server Sent Events to the browser.
View README.md

Generate a new Elixir project using mix and add cowboy and plug as dependencies in mix.exs:

  defp deps do
    [
      {:cowboy, "~> 1.0.0"},
      {:plug, "~> 0.8.1"}
    ]
  end
@viniciussbs
viniciussbs / apollo-1-migration.md
Created May 2, 2017 — forked from helfer/apollo-1-migration.md
Migrating from Apollo Client 0.x to 1.0
View apollo-1-migration.md

Migrating from Apollo Client 0.x to 1.0

Here are the main breaking changes between the 0.x and 1.0 versions of Apollo Client.

fetchMore

The structure of fetchMoreResult has been changed. Previously fetchMoreResult used to contain data and loading fields, now fetchMoreResult is what fetchMoreResult.data used to be. This means your updateQueries function has to change as follows:

updateQuery: (prev, { fetchMoreResult }) => {
View spacemacs-cheatsheet.txt
`emacs --daemon` to run in the background.
`emacsclient.emacs24 <filename/dirname>` to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
* Undo - `C-/`
* Redo - `C-?`
* Change case: 1. Camel Case : `M-c`
2. Upper Case : `M-u`
3. Lower Case : `M-l`
View commit-message-style-guide.txt
A good commit message looks like this:
Header line: explaining the commit in one line
Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc etc.
The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
@viniciussbs
viniciussbs / 1-single-user.js
Last active Feb 9, 2017
Relay-style GraphQL pagination using Apollo Client on Ember (ember-apollo-client).
View 1-single-user.js
// app/routes/users/user.js
import Ember from 'ember';
import gql from 'graphql-tag';
import ObservableQuery from '../../mixins/observable-query';
const { Route } = Ember;
export default Route.extend(ObservableQuery, {
query: gql`