Skip to content

Instantly share code, notes, and snippets.

View ballPointPenguin's full-sized avatar
💜

Bennie Rosas ballPointPenguin

💜
View GitHub Profile
@knomedia
knomedia / ember_cli_rails.rake
Last active August 29, 2015 14:00
ember_cli_rails initial thoughts (see: https://github.com/knomedia/ember-cli-rails for a more complete solution)
View ember_cli_rails.rake
require 'nokogiri'
namespace :ember_cli_rails do
desc "compile ember and update application.html.erb with ENV vars"
task :build => [:ember, :update_env] do
end
desc 'Build ember app and copies css and js files to rails'
@2468ben
2468ben / config.js
Created September 10, 2015 01:48
Active Model Sideload-only Serializer code
View config.js
//mirage/config.js
import Em from 'ember';
import utils from 'ember-cli-mirage/shorthands/utils';
import serializerDefs from 'crowdly-pa/tests/helpers/serializer-defs';
import SerializerMachine from 'crowdly-pa/tests/helpers/serializer-machine';
import { pluralize } from 'ember-inflector';
export default function() {
this.timing = 50; // delay for each request, automatically set to 0 during testing
}
@abuiles
abuiles / build.sh
Last active March 2, 2017 13:45
ember-cli + Rails build
View build.sh
#!/bin/bash
# Based on https://github.com/knomedia/ember-cli-rails/blob/master/build.sh
# for (( i = 0; i < 17; i++ )); do echo "$(tput setaf $i)This is ($i) $(tput sgr0)"; done
function printMessage {
color=$(tput setaf $1)
message=$2
reset=$(tput sgr0)
echo -e "${color}${message}${reset}"
@mikeal
mikeal / gist:9242748
Last active June 23, 2020 05:17
Response to Nodejitsu NPM Trademark
View gist:9242748

I've known people at nodejitsu for years, since before the company even existed. I still consider many of them friends. That said, somebody over there has lost their mind.

Trademarks are an important part of open source. They protect the integrity of the trust that is built by any project. A classic example of why this is the case is Firefox. Suppose that a malware producer takes the Firefox codebase, which is free and open source, packages up their malware with it and then releases it as "Firefox". Then they buy search advertising and suddenly their bad and malicious version of Firefox is the first result on search engines across the web. This is clearly a bad thing for Firefox and open source everywhere, but what can Mozilla do to protect their community of users?

They can't enforce a software license since the use is permitted under the Mozilla Public License. They can, however, enforce on these hypothetical bad actors using their trademark on the word "Fi

@data-enhanced
data-enhanced / vs-code-turnoff-autocomplete.json
Last active October 3, 2020 03:18
Turn off autocompletion (intellisense) in MS Visual Studio Code
View vs-code-turnoff-autocomplete.json
// Turn off autocomplete in Visual Studio Code
// http://code.visualstudio.com/
// Add the following lines to user settings
// OPTIONAL WORD WRAPPING
// Controls if lines should wrap. The lines will wrap at min(editor.wrappingColumn, viewportWidthInColumns).
"editor.wordWrap": true,
// Controls the indentation of wrapped lines. Can be one of 'none', 'same' or 'indent'.
"editor.wrappingIndent": "indent",
@eteeselink
eteeselink / delay.js
Created November 13, 2015 13:55
ES7 async/await version of setTimeout
View delay.js
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
async function something() {
console.log("this might take some time....");
await delay(5000);
console.log("done!")
}
something();
@jwo
jwo / registrations_controller.rb
Created September 30, 2011 23:11
API JSON authentication with Devise
View registrations_controller.rb
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@1Marc
1Marc / workshops-planning.md
Last active January 20, 2023 02:34
Workshop Planning
View workshops-planning.md

This gist is no longer in use.

@samselikoff
samselikoff / future-proof.md
Last active April 21, 2023 17:14
Future-proofing your Ember 1.x code
View future-proof.md

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@alex-zige
alex-zige / gist:5795358
Last active June 8, 2023 07:49
Rails Rspec API Testing Notes
View gist:5795358

Rails Rspec APIs Testing Notes

Folders Structure

  spec
  |--- apis #do not put into controllers folder. 
        |--- your_api_test_spec.rb  
  |--- controllers
  |--- models
  |--- factories
 |--- views