Skip to content

Instantly share code, notes, and snippets.

View brunowego's full-sized avatar
🎯
Focusing

Bruno Wego brunowego

🎯
Focusing
View GitHub Profile
@tychay
tychay / config.js
Last active March 1, 2017 19:05 — forked from pywebdesign/config.js
Restangular adapter to expand compound documents from jsonapi.org
// This variation just injects the extracted data right into the relationships and also stores things in
// ._meta and ._included instead of just .included
// it (like restangular) requires either lodash or underscorejs
.config(function(RestangularProvider) {
// add a response interceptor
RestangularProvider.addResponseInterceptor(function(data, operation, what, url, response, deferred) {
var extractedData = data.data;

Overview

Our app relies entirely on the current_user helper method (found in our ApplicationController) to retrieve the User object associated with the currently logged-in user (if any). You guys are using the devise gem for authentication, but you still have a current_user helper method which is made available to ApplicationController (and all subclasses).

Normally, the current_user method looks something like this:

def current_user
  # do some magic to get the user id from the (encrypted) session cookie…
 user_id = get_user_id_from_session
@gustaff-weldon
gustaff-weldon / application.controller.js
Last active March 1, 2017 19:35
Ember input-radio and radio-group
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
options: [
{ name: 'Apple', value: 'apple'},
{ name: 'Banana', value: 'banana'},
{ name: 'Other', value: 'other'}
],
selected: { name: 'Banana', value: 'banana'},
@schmidt1024
schmidt1024 / media-queries.css
Last active November 1, 2017 15:05
CSS Media Queries - Solo and Bootstrap way
/* Solo Queries
*********************************************/
/* Phones (portrait and landscape) */
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {}
/* Phones (landscape) */
@media only screen and (min-width: 321px) {}
/* Phones (portrait) */
@jonschlinkert
jonschlinkert / 1. handlebars-subexpression.html
Last active February 3, 2018 05:51
Very powerful combination! Four helpers are used here: `each`, `expand`, `markdown` and `inline`.
{{#each (expand 'content/*.md')}}
{{#markdown}}
{{inline .}}
{{/markdown}}
{{/each}}

br helper

usage

{{#br [number of breaks]}}
// content
{{/br}}
@anaisbetts
anaisbetts / the original guy used autocrlf false
Created May 27, 2012 06:58
.gitattributes to solve your problems
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
@zdwolfe
zdwolfe / gist:6721115
Last active October 1, 2018 06:38
Basic nginx configuration for AngularJS html5Mode
server {
listen 0.0.0.0:12345;
location / {
root /home/zdwolfe/src/angularAWS/app;
try_files $uri $uri/ /index.html =404;
}
}
@drslump73
drslump73 / config.vim
Last active January 22, 2019 21:43
spacevim config
# at .SpaceVim.d/autoload/config.vim
func! config#before() abort
let g:mapleader=','
set conceallevel=0
endf
func! config#after() abort
let g:mapleader=','
" Here are some basic customizations, please refer to the ~/.SpaceVim.d/init.vim
" file for all possible options:
let g:spacevim_default_indent = 4
let g:spacevim_max_column = 80
" Change the default directory where all miscellaneous persistent files go.
" By default it is ~/.cache/vimfiles.
let g:spacevim_plugin_bundle_dir = '~/.cache/vimfiles'
" set SpaceVim colorscheme