Skip to content

Instantly share code, notes, and snippets.

/* modernizr-test.js
* Daniel Ott
* 3 March 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
*/
@CoHyper
CoHyper / get files in folder javascript node
Created August 14, 2014 12:27
NodeJs get files in folder javascript node
var _getAllFilesFromFolder = function(dir) {
var filesystem = require("fs"),
results = [];
filesystem.readdirSync(dir).forEach(function(file) {
file = dir+'/'+file;
var stat = filesystem.statSync(file);
if (stat && stat.isDirectory()) {
@CoHyper
CoHyper / bash
Last active March 13, 2016 11:15
open sublime in terminal
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
@CoHyper
CoHyper / bash
Last active April 27, 2024 16:06
bash Add Spacer to OS X Dock
$ defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
$ killall Dock
@CoHyper
CoHyper / my_ip.js
Created April 20, 2015 23:49
My IP Javascript
function myIP() {
var i = 0,
hostipInfo,
xmlhttp,
ipAddress;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
@CoHyper
CoHyper / recursively.js
Last active July 27, 2016 20:50
NodeJS - Get a list of all files from a folder recursively
'use strict';
const fs = require('fs');
/**
* Get a list of all files from a folder recursively
*
* @param {String} dir - The path of the directory folder
* @param {Array} [filelist=[]] - The list of all files
* @return {Array} - Returns the list of all files
@CoHyper
CoHyper / gist:d8ea9a8cf72d98262ad0
Created February 1, 2016 14:29
JS Browser 320, 480
javascript:void((function(){window.open(document.location.href,'window_1','width=320,height=460,left=0,top=0');})());
javascript:void((function(){window.open(document.location.href,'window_2','width=460,height=320,left=320,top=0');})());
@CoHyper
CoHyper / babel.js
Last active February 24, 2016 23:59
utilities gulp-babel
var gulp = require('gulp'),
babel = require('gulp-babel');
module.exports = function() {
return gulp.src('./src/**/*.js')
.pipe(babel({
sourceMaps: false,
@CoHyper
CoHyper / browserify.js
Created February 25, 2016 00:07
Utilities gulp-browserify
var gulp = require('gulp'),
browserify = require('browserify'),
buffer = require('vinyl-buffer'),
gutil = require('gulp-util'),
rename = require('gulp-rename'),
source = require('vinyl-source-stream'),
sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglify');
@CoHyper
CoHyper / generate_docs.sh
Last active April 27, 2024 16:09
bash Start create documentation
#!/usr/bin/env bash
if [ ! -f ./node_modules/.bin/jsdoc ]
then
npm rebuild
fi
# sh ./build.sh &&
echo "Start create documentation" &&