curl -L https://gist.github.com/jbbn/b4ddec6775668b7fe0553c9a4f06d328/raw/install.sh | bash
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
cloc --exclude-dir=node_modules . |
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
find .. -name .git -type d -execdir sh -c 'echo "\033[92m $(pwd) \033[0m"; git fetch --all; git status; echo ""' \; |
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
<?php | |
function pipe ($fns) { | |
return function ($value) use ($fns) { | |
return array_reduce( | |
$fns | |
, function ($previousValue, $fn) { | |
return call_user_func($fn, $previousValue); | |
} | |
, $value | |
); |
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 string_to_slug (str) { | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "àáäâãèéëêìíïîòóöôõùúüûñç·/_,:;"; | |
var to = "aaaaaeeeeiiiiooooouuuunc------"; | |
for (var i=0, l=from.length ; i<l ; i++) { | |
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
} |
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
const fs = require('fs') | |
const { log, splitByBreakline } = require('./utils') | |
const { getAnagramsFromWordsWith } = require('./utils.anagrams') | |
const logAnagramsFromFile = (filepath, target) => { | |
const getAnagramsForTargetFromWords = getAnagramsFromWordsWith(target) | |
// splitByBreakline | getAnagramsForTargetFromWords | log | |
const handleFileCallback = (err, words) => log( | |
getAnagramsForTargetFromWords( |
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 { createStore, combineReducers, bindActionCreators} from 'redux' | |
import Revue from 'revue' | |
import { Provider, connect } from 'react-redux' | |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
const counter = (state = 0, action) => { |
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
// http://stackoverflow.com/questions/667555/detecting-idle-time-in-javascript-elegantly | |
var inactivityTime = function () { | |
var t; | |
window.onload = resetTimer; | |
// DOM Events | |
document.onmousemove = resetTimer; | |
document.onkeypress = resetTimer; | |
function logout() { | |
alert("You are now logged out.") |
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
<?php | |
define('DS', DIRECTORY_SEPARATOR); | |
function _getExtractSchemaStatement($sqlFileName, $db) | |
{ | |
$dumpSchema = 'mysqldump' . ' '; | |
$dumpSchema .= '--no-data' . ' '; | |
$dumpSchema .= '-u ' . $db['user'] . ' '; | |
$db['pass'] = (string) $db['pass']; |
NewerOlder