Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Jeff Dickey jdxcode

👋
View GitHub Profile
View awesome.rb
class Fixnum
define_method :+ do |i|
rand(100) == 42 ? 42 : i - -self
end
end
@jdxcode
jdxcode / stupid.rb
Created Apr 16, 2014
dont let me near ruby
View stupid.rb
class Fixnum
def random_number_between_oneAndTEN!(yaSuRE)
if yaSuRE == 'ya dude!'
return rand(10)
else
raise 'YA GATTA TYPE YA DUDE!!!!!!!'
end
end
end
View app.sh
mkdir mynewapp
cd mynewapp
echo "{}" > package.json
npm install --global gulp
npm install --save-dev gulp
npm install --save-dev gulp-less
@jdxcode
jdxcode / app.css
Created Apr 29, 2014
compiled less example
View app.css
.class1 {
background-color: #2d5e8b;
}
.class2 {
background-color: #fff;
color: #2d5e8b;
}
.class3 {
border: 1px solid #2d5e8b;
}
@jdxcode
jdxcode / gulpfile.js
Last active Aug 29, 2015
basic less compilation
View gulpfile.js
var gulp = require('gulp');
var less = require('gulp-less');
gulp.task('less', function() {
return gulp.src('css/app.less')
.pipe(less())
.pipe(gulp.dest('dist'));
});
@jdxcode
jdxcode / app.less
Last active Aug 29, 2015
basic less example
View app.less
@color-base: #2d5e8b;
.class1 {
background-color: @color-base;
}
.class2 {
background-color: #fff;
color: @color-base;
}
.class3 {
@jdxcode
jdxcode / gulpfile.js
Last active Aug 29, 2015
gulp with javascript concatenation
View gulpfile.js
var gulp = require('gulp');
var less = require('gulp-less');
var concat = require('gulp-concat');
gulp.task('less', function() {
return gulp.src('css/app.less')
.pipe(less())
.pipe(gulp.dest('dist'));
});
@jdxcode
jdxcode / gulpfile.js
Last active Aug 29, 2015
gulpfile for angular.js
View gulpfile.js
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var ngmin = require('gulp-ngmin');
gulp.task('scripts', function() {
return gulp.src(['src/**/module.js', 'src/**/*.js'])
.pipe(concat('app.js'))
.pipe(ngmin())
.pipe(uglify())
@jdxcode
jdxcode / gulpfile.js
Last active Aug 29, 2015
Gulp less watch
View gulpfile.js
var gulp = require('gulp');
var less = require('gulp-less');
gulp.task('less', function() {
return gulp.src('css/app.less')
.pipe(less())
.pipe(gulp.dest('dist'));
});
gulp.task('watch', ['less'], function() {
View rev-manifest.json
{
"app.css": "app-1c1d3237.css",
"app.js": "app-26ad0c3f.js"
}