Skip to content

Instantly share code, notes, and snippets.

Chris G. roparz

Block or report user

Report or block roparz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@roparz
roparz / routes.coffee
Last active Aug 29, 2015
AngularJS route builder that avoid declaration duplication
View routes.coffee
_build = (callback) ->
string = callback.toString()
mathes = string.match /function\s?\(([\w,\s?\$]+)\)\s?\{/
arr = mathes[1].split(', ')
arr.push callback
return arr
# using AngularUI Router
angular.module('app').config ($stateProvider) ->
@roparz
roparz / cg-contenteditable.coffee
Last active Aug 29, 2015
cg-contenteditable - AngularJS directive to manage contenteditable element (in CoffeeScript)
View cg-contenteditable.coffee
angular.module('whatever').directive 'cgContenteditable', ->
restrict: 'A'
scope:
ngModel: '='
link: (scope, elem, attrs) ->
elem = elem[0]
# 1
elem.setAttribute 'contenteditable', true
# 2
@roparz
roparz / check-css.js
Last active Aug 29, 2015
gulp-sniffer - check css exemples
View check-css.js
var gulp = require('gulp'),
sniffer = require('gulp-sniffer');
var sniffs = {
'Use lighter|normal|bold instead of 100-900 for font-weight': function(content) {
return content.match(/font-weight: \d+/);
}
}
gulp.task('check-css', function() {
@roparz
roparz / check-tabs.js
Created Jul 26, 2015
gulp-sniffer - check tabs exemple
View check-tabs.js
'This file uses tabs instead of spaces for indentation': function(content) {
return content.match(/\t/g);
}
@roparz
roparz / .zshrc
Created Oct 18, 2017
Git log stay displayed
View .zshrc
export LESS="-RFX"
View keybase.md

Keybase proof

I hereby claim:

  • I am roparz on github.
  • I am roparz (https://keybase.io/roparz) on keybase.
  • I have a public key ASAiDnGuW_Q9XWixNgCkZTyFbpdszw0JTuPPxQq56l6S2go

To claim this, I am signing this object:

@roparz
roparz / README.md
Last active Jun 13, 2018
Pull-request merge process
View README.md

Pull-request merge process

When it's a fix or feature branch

If I consider that all commits of the branch are good (well named, concerns correctly separated) then I use the Rebase and merge option. All commits are merge into develop as is without creating a merge commit (they are put just after the last commit in develop).

In the other hand, if there are "Work in progress" (WIP) commits in the branch, or if I consider that all commits refer to the same fix/feature and should be grouped, I use the Squash and merge option. All commits are grouped in one commit and put in develop (still without creating a merge commit). The commit will default take the name of the pull-request but you can change it if needed.

@roparz
roparz / .gitconfig
Last active Apr 18, 2019
Git config
View .gitconfig
[alias]
st = status
ci = commit
co = checkout
br = branch
rz = reset --hard HEAD
unwip = reset HEAD^
pr = pull --rebase
pf = push --force-with-lease
cp = cherry-pick
@roparz
roparz / aws-s3-rename.coffee
Created Jul 23, 2014
Rename object with Node.js AWS S3 (copy object then delete object) with promises
View aws-s3-rename.coffee
config = require 'config'
s3 = require 's3'
q = require 'q'
module.export = (oldKey, newKey) ->
defer = q.defer()
params =
# you need to set the s3 bucket in the CopySource key
CopySource: "#{ config.s3.bucket }/#{ oldKey }"
You can’t perform that action at this time.