Skip to content

Instantly share code, notes, and snippets.

🤠
¯\_(ツ)_/¯

Leo Taifa Merinen leotm

🤠
¯\_(ツ)_/¯
Block or report user

Report or block leotm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leotm
leotm / rename.js
Last active Aug 29, 2015
Node.js - Rename file(s)
View rename.js
var glob = require('glob');
var fs = require('fs');
// Find file(s)
glob('fileName.ext', function(err, files) {
if (err) { throw err; }
// Check for file(s)
if (Boolean(files.length)) {
files.forEach(function(item, index, array) {
var newItem = item.replace('regexp', 'replacement');
@leotm
leotm / append.js
Last active Aug 29, 2015
Node.js - Append regexp to file(s)
View append.js
var glob = require('glob');
var fs = require('fs');
// Find file(s)
glob('fileName.ext', function(err, files) {
if (err) { throw err; }
files.forEach(function(item, index, array) {
console.log(item + ' found.');
// Read file(s)
var file = fs.readFileSync(item, 'utf8');
@leotm
leotm / delete.js
Last active Aug 29, 2015
Node.js - Delete file(s)
View delete.js
var glob = require('glob');
var fs = require('fs');
// Find file(s)
glob('**/fileName.ext', function(err, files) {
if (err) { throw err; }
files.forEach(function(item, index, array) {
console.log(item + ' found');
// Delete file(s)
fs.unlink(item, function(err) {
@leotm
leotm / .jscsrc
Last active Aug 29, 2015
JSCS - JavaScript Code Style - Rules
View .jscsrc
{
"jscsVersion": "2.0.0",
"preset": "google",
"fileExtensions": [".js", "jscs"],
"validateQuoteMarks": true,
"requireParenthesesAroundIIFE": true,
"maximumLineLength": 120,
"validateLineBreaks": "LF",
@leotm
leotm / getLinks.js
Last active Aug 29, 2015
Get all links from website
View getLinks.js
@leotm
leotm / getLinks.js
Last active Aug 29, 2015
Download all links from website
View getLinks.js
@leotm
leotm / git-cmd.bat
Last active Aug 29, 2015
GitHub for Windows - amended git-cmd.bat path to open in "Documents\GitHub" folder
View git-cmd.bat
@rem Do not use "echo off" to not affect any child calls.
@setlocal
@rem Get the absolute path to the current directory, which is assumed to be the
@rem Git installation root.
@for /F "delims=" %%I in ("%~dp0") do @set git_install_root=%%~fI
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%PATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%\Documents\GitHub
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@leotm
leotm / win10lnks.txt
Created Aug 6, 2015
Windows 10 shortcuts
View win10lnks.txt
Quick Launch: C:\Users\<User>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch
TaskBar: C:\Users\<User>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
Start Menu: C:\Users\<User>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
Links: C:\Users\<User>\.cr3\Links
@leotm
leotm / page.is_addLink.js
Last active Aug 29, 2015
Page.is - Add Link - add more social profiles
View page.is_addLink.js
@leotm
leotm / page.hbs
Created Oct 9, 2015 — forked from jack0088/page.hbs
Ghost - List of posts inside post.hbs and page.hbs
View page.hbs
...
{{> posts_list}}
...
You can’t perform that action at this time.