Skip to content

Instantly share code, notes, and snippets.

View rbinsztock's full-sized avatar
🏎️

Rémy Binsztock rbinsztock

🏎️
View GitHub Profile
@rbinsztock
rbinsztock / Update NPM with NVM Windows
Created May 17, 2019 09:37
Update NPM with NVM Windows
I think this is more of a previous npm version bug than nvm one.
However, to update npm delete in nvm/[node version] folder (for me it is v10.15.3) following files:
C:\Users\[user name]\AppData\Roaming\nvm\[node version]\npm
C:\Users\[user name]\AppData\Roaming\nvm\[node version]\npm.cmd
C:\Users\[user name]\AppData\Roaming\nvm\[node version]\npx
C:\Users\[user name]\AppData\Roaming\nvm\[node version]\npx.cmd
Rename npm folder to npm2
import fooTemplate from './foo.html';
import barTemplate from './bar.html';
app.directive('dyntemplate', function() {
return {
templateUrl: function(elem, attrs) {
if (attrs.templateUrl === 'foo.html') {
return fooTemplate;
}
return barTemplate;
@rbinsztock
rbinsztock / routes.coffee
Created August 19, 2015 08:04 — forked from merqlove/routes.coffee
Global Resolve for Angular ngRoute
'use strict';
angular.module('app.routes').config([
'$routeProvider', function($routeProvider) {
return angular.extend({}, $routeProvider, {
orgWhen: function(path, route) {
route.resolve || (route.resolve = {});
route.resolve = _.merge(route.resolve, {
chef: 'OrganizationCheckerProvider'
});
return $routeProvider.when.call(this, path, route);
// In index.html we have...
<body>
<div ng-view class="{{animateStyle}}">
</div>
</body>
// Which allows us to apply page transition animations. So, for example, to slide left from page A to page B we
// write javascript
or
<body>
app.controller "ArticlesController", ($scope, $http, $location, $state, $stateParams, Article) ->
# =========================================================================
# Initialize
# =========================================================================
$scope.articles = {}
$scope.article = {}
# =========================================================================
-----> Compiled slug size: 10.7MB
-----> Launching... ! Heroku push rejected, Could not communicate with vendor, please try again later
To git@heroku.com:protected-spire-4753.git
! [remote rejected] master -> master (pre-receive hook declined)
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;
<% div_for comment do %>
<h1>Commentaire ajouté par <%= comment.user.login %></h1>
<p class="comment-body"><%= comment.comment %></p>
<p>Depuis <%= time_ago_in_words(comment.created_at) %></p>
<%= link_to 'Effacer commentaire', comment, :method => :delete, :class => "delete", :remote => true %>
<% end %>