Skip to content

Instantly share code, notes, and snippets.

View troynt's full-sized avatar

Troy Thompson troynt

View GitHub Profile
@DarrenN
DarrenN / get-npm-package-version
Last active April 17, 2024 16:57 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@miroslavpopovic
miroslavpopovic / consoleDiff.js
Last active December 14, 2015 08:58
A function that's using https://github.com/kpdecker/jsdiff to display a difference between two strings in a console. Tested on latest versions of Firebug and Chrome Developer Tools. Developer tools in IE 10 and below don't support CSS styles in console.
(function() {
// A function that's using https://github.com/kpdecker/jsdiff to display a
// difference between two strings in a console.
// Tested on latest versions of Firebug and Chrome Developer Tools.
// Developer tools in IE 10 and below don't support CSS styles in console.
var consoleDiff = function (first, second, diffType) {
var normalStyle = 'color: black; background-color: white; text-decoration: none;',
addStyle = 'color: #406619; background-color: #eaf2c2; text-decoration: none;',
removeStyle = 'color: #b30000; background-color: #fadad7; text-decoration: line-through;',
text = '',
@josegonzalez
josegonzalez / deploy.rb
Created October 23, 2010 16:40
Capistrano Deploy Script for CakePHP applications using GIT (Update the $config hash))
$config = {
"application" => "DOMAIN.TLD",
"repository" => "git@GITHOST:USERNAME/REPOSITORYNAME.git",
"remoteusername" => "REMOTEUSERNAME",
"cake_folder" => "/PATH/TO/CAKE",
"cake_version" => "cakephp1.3",
"plugin_dir" => "plugins",
"servers" => {
"prod" => {
"server" => "APPLICATION.TLD",
C:\Users\Luis>ruby -v
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
C:\Users\Luis>gem install mysql2 --platform=ruby -- --with-mysql-include=C:\mysql-5.1.51-win32\include --with-mysql-lib=C:\mysql-5.1.51-win32\lib\opt
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed mysql2-0.2.5
1 gem installed
C:\Users\Luis>irb