This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module StimulusHelper | |
CouldNotLoadStimulus = Class.new(StandardError) do | |
def initialize(missing_controllers) | |
super("Could not load all controllers. missing: #{missing_controllers}") | |
end | |
end | |
# Reads the list of controllers from the filesystem | |
APPLICATION_CONTROLLERS = Dir[Rails.root.join('app/javascript/controllers/*')].map do |path| | |
File.basename(path).gsub('_controller.js', '').gsub('_', '-') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install JSON support | |
brew install jansson | |
Install Universal CTGAS | |
brew install --with-jansson --HEAD universal-ctags/universal-ctags/universal-ctags | |
Install CTAGS sublime plugin | |
https://github.com/SublimeText/CTags | |
Generate tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# Copyright 2015 Álvaro Justen <https://github.com/turicas/rows/> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GIT REBASE | |
# - VI replace pick -> fixup | |
:%s/pick/fixup/g | |
# replace " x x x" -> "" | |
:%s/\(\s\+x\)\+/\s/g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kill -9 $(ps aux | grep spring | awk '{print $2}' | head -n 1) | |
kill -9 $(ps aux | grep webkit | awk '{print $2}' | head -n 1) | |
# Find files and remote by pattern | |
find /path/to/directory -type f -name '*[0-9]x[0-9]*[0-9]x[0-9]*.jpg' -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delete_branches | |
pattern = /CT-\d{4}/ | |
result = `git branch` | |
branches = result.split("\n").map(&:strip) | |
branches.each do |branch| | |
if branch =~ pattern | |
puts `git branch -d #{branch}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {Object|String} data string or keys of object are named in form of snake | |
* @param {number} depth to which level of keys should it process | |
* @return {Object|String} string or keys of object are named in form of camel case | |
*/ | |
exports.snakeToCamel = function(data, depth) { | |
if (Util.isObject(data)) { | |
if (typeof depth === 'undefined') { | |
depth = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/support/requests/auth_helpers.rb | |
module Requests | |
module AuthHelpers | |
module Extensions | |
def sign_in(user) | |
let(:auth_helpers_auth_token) { | |
self.public_send(user).create_new_auth_token | |
} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Use Non-ASCII Font" : false, | |
"Tags" : [ | |
], | |
"Ansi 12 Color" : { | |
"Red Component" : 0.4405802488327026, | |
"Color Space" : "Calibrated", | |
"Blue Component" : 0.5168579816818237, | |
"Alpha Component" : 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Ocean.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 21, | |
"highlight_line": true, | |
"ignored_packages": | |
[ | |
"JavaScript", | |
"SublimeERB", |
NewerOlder