Instead of making huge functions that makes a lot of things given a set of options, prefer splitting them into small atoms.
<?php
/**
(async () => { | |
const keys = []; | |
const songs = []; | |
const index = () => { | |
const rows = $('.datagrid-row'); | |
rows.each((i, el) => { | |
const row = $(el); | |
const key = row.attr('data-key'); |
cclive \ | |
--stream best \ | |
--filename-format "%t" \ | |
--exec 'echo "Converting to audio..."' \ | |
--exec 'ffmpeg -loglevel warning -i "%f" -codec copy -map 0:a "%n.mp4"' \ | |
--exec 'echo "Cleaning temp file..."' \ | |
--exec 'rm "%f"' \ | |
--exec 'echo "You can now listen to %t.mp4' \ | |
"$1" \ | |
/ |
<?php | |
function doSomething() { | |
// 10 LOC | |
} | |
function doSomethingElse() { | |
// 20 LOC | |
} |
/** | |
* Adds an accessibility layer to the default noUiSlider. | |
* | |
* @see $.fn.noUiSlider() | |
*/ | |
$.fn.noUiSliderA11y = function(options, rebuild) { | |
var slider = this; | |
if (!('noUiSlider' in slider)) { | |
throw new Error('noUiSlider is not loaded.'); |
/** | |
* Compares Ol3 and Zoomify algorithms for calculating tier sizes. | |
*/ | |
var DEFAULT_TILE_SIZE = 256; | |
/** | |
* Original Ol3 algorithm. | |
*/ | |
var ol = function(imageWidth, imageHeight) { |
<?php | |
define( 'ECHO_COUNT', 10000 ); | |
define( 'EXECUTION_COUNT', 100 ); | |
function coma( ) { | |
for ( $i = 0; $i < ECHO_COUNT; $i++ ) { | |
echo 'a ', $i, ' b ', $i, ' c'; | |
} | |
} |
#ifndef FACTORY_H | |
#define FACTORY_H | |
#include <QList> | |
#include <QHash> | |
typedef QHash< QString, QString > Informations; | |
typedef QHashIterator< QString, QString > InformationsIterator; | |
# apt | |
alias search='apt-cache search' | |
alias install='sudo apt-get install' | |
# git | |
alias gs='git status' # overwrites ghostscript | |
alias ga='git add .' | |
alias gc='git commit -m' |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>FG</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |