This file contains hidden or 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
<button class="js-slide-toggle__btn">toggle</button> | |
<div class="js-slide-toggle__content"> | |
Nunc nec neque. In turpis. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. In auctor lobortis lacus. | |
Etiam sit amet orci eget eros faucibus tincidunt. Proin faucibus arcu quis ante. Sed aliquam ultrices mauris. Aenean viverra rhoncus pede. Donec interdum, metus et hendrerit aliquet, dolor diam sagittis ligula, eget egestas libero turpis vel mi. | |
</div> |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Hook to make sure that no commit message line is lower then 10 characters | |
while read line; do | |
# Skip comments | |
if [ "${line:0:1}" == "#" ]; then | |
continue | |
fi | |
if [ ${#line} -le 10 ]; then |
This file contains hidden or 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
import { Pipe, PipeTransform } from '@angular/core'; | |
import * as format from 'date-fns/format'; | |
@Pipe({ | |
name: 'dateFnsFormat' | |
}) | |
export class DateFnsFormatPipe implements PipeTransform { | |
transform(value, args?) { | |
return format(value, args); |
This file contains hidden or 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
-- This code is fork from https://gist.github.com/oliveratgithub/ | |
-- Open in AppleScript Editor and save as Application | |
-- ------------------------------------------------------------ | |
--this is required to break the filename into pieces (separate name and extension) | |
set text item delimiters to "." | |
tell application "Finder" | |
set all_files to every item of (choose file with prompt "Choose the Files you'd like to rename:" with multiple selections allowed) as list | |
display dialog "New file name:" default answer "" | |
set new_name to text returned of result | |
--now we start looping through all selected files. 'index' is our counter that we initially set to 1 and then count up with every file. |
This file contains hidden or 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
/** | |
* Original code from https://github.com/mike-schultz/materialette | |
*/ | |
function rgbToHex(r, g, b) { | |
return "#" + ((1 << 24) + (parseInt(r) << 16) + (parseInt(g) << 8) + parseInt(b)).toString(16).slice(1); | |
} | |
function hexToRgb(hex) { | |
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); |
This file contains hidden or 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
.row, | |
.row > * { | |
box-sizing: border-box; | |
} | |
.row::after { | |
content: ""; | |
clear: both; | |
display: block; | |
} | |
.row .col-1 {width: 8.33%;} |
This file contains hidden or 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
var obj = {b: 3, c: 2, a: 1}; | |
_.sortKeysBy(obj); | |
// {a: 1, b: 3, c: 2} | |
_.sortKeysBy(obj, function (value, key) { | |
return value; | |
}); | |
// {a: 1, c: 2, b: 3} |
This file contains hidden or 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
function debug() { | |
if (arguments.length > 1) { | |
return console.log(arguments[0], JSON.stringify(arguments[1], null, 2)); | |
} else { | |
return console.log(JSON.stringify(arguments[0], null, 2)); | |
} | |
} |
This file contains hidden or 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
gulp.task('createFile', function() { | |
var filename = 'app.js'; | |
var string = "(function() {\n 'use strict';\n angular.module('App', ['ui-route']);\n})();"; | |
return stringToFile(filename, string) | |
.pipe(gulp.dest('./js')); | |
}); | |
function stringToFile(filename, string) { | |
var src = require('stream').Readable({ objectMode: true }); | |
src._read = function () { |
This file contains hidden or 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
var gulp = require('gulp'), | |
watch = require('gulp-watch'), | |
// This will keeps pipes working after error event | |
plumber = require('gulp-plumber'), | |
// linting | |
jshint = require('gulp-jshint'), | |
stylish = require('jshint-stylish'), |