Skip to content

Instantly share code, notes, and snippets.

View ManzDev's full-sized avatar
💻
Trapped inside a terminal

Manz ManzDev

💻
Trapped inside a terminal
View GitHub Profile
@ManzDev
ManzDev / MakeOnSave.py
Last active August 29, 2015 14:12
Sublime Text 3: Build minified CSS file (with autoprefixer) and JS minified file on save (paths for Windows).
import sublime, sublime_plugin, os
class MakeOnSave(sublime_plugin.EventListener):
def on_post_save(self, view):
if view.file_name().endswith('.js'):
folder_name, file_name = os.path.split(view.file_name())
file_name, file_ext = file_name.split('.')
view.window().run_command('exec', {
'cmd': ['node', os.environ['APPDATA'] + '\\npm\\node_modules\\minifier\\index.js', '--no-comments', file_name+'.js', '-o', file_name+'.min.js'],
'working_dir': folder_name
@ManzDev
ManzDev / conky.conf
Last active June 11, 2018 03:47
Conky Laptop Widget
# conky configuration
# edited by twitter.com/Manz (based on [email protected])
# set to yes if you want Conky to be forked in the background
background no
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
@ManzDev
ManzDev / tint2rc
Created March 4, 2015 13:36
Tint2 Panel Configuration
# Tint2 config file
# Background definitions
# ID 1
rounded = 0
border_width = 0
background_color = #212121 60
border_color = #FFFFFF 13
# ID 2
@ManzDev
ManzDev / reducepdf.bat
Last active November 1, 2019 11:21
Reduce size PDF file (needs GhostScript)
@echo off
chcp 1252 >nul
set argc=0
for %%x in (%*) do set /a argc+=1
if [%argc%] == [0] goto syntax
if [%argc%] == [1] goto default
if [%argc%] == [2] goto param
@ManzDev
ManzDev / nef2jpg.bat
Created April 30, 2015 14:56
Convert NEF (Nikon RAW) to JPG image (needs Imagemagick)
@echo off
rem DANGER!! Default convert.exe system is a NTFS disk converter. Use where convert.exe and change it for imagemagick convert.
set imconvert="C:\Program Files\ImageMagick-6.8.8-Q16\convert.exe"
chcp 1252 >nul
set argc=0
for %%x in (%*) do set /a argc+=1
@ManzDev
ManzDev / delcorruptedjpg.bat
Last active March 27, 2016 00:43
Delete corrupted JPG (require ImageMagick)
mkdir corrupted
for /R %%d in (*.jpg) do (identify "%%d" & if ERRORLEVEL 1 move "%%d" corrupted)
// JS (ES6)
obj = { uno: 1, dos: 2 }
var obj2 = Object.assign({}, obj);
obj.tres = 3
// JS (ES5)
obj = { uno: 1, dos: 2 }
var clone = function(original) {
@ManzDev
ManzDev / deal
Created January 27, 2017 19:49
Deal with it (Linux terminal edition)
#!/bin/sh
# Detect terminal width
columns=$(stty -a <`tty` | grep -Po '(?<=columns )\d+')
if test $columns -lt 90
then
echo Your console should be larger than 90 chars width.
exit
fi
@ManzDev
ManzDev / atom-install.sh
Last active September 15, 2017 22:40
Install for atom editor
// Fonts
wget --no-check-certificate https://download.damieng.com/fonts/original/EnvyCodeR-PR7.zip
unzip EnvyCodeR-PR7.zip
// UI & Syntax (Disable icons in dash-ui settings)
apm install dash-ui atom-file-icons
apm install ax-monokai-syntax atom-json-color
// Optional syntax improvements (disabled)
apm install ariake-dark-syntax duotone-dark-syntax atom-monokai
@ManzDev
ManzDev / videosplit.js
Created September 13, 2017 20:34
Split, divides or cut a long video in mp4 parts (requires ffmpeg)
#!/usr/bin/env node
let fs = require('fs'); // FileSystem
let cmd = require('child_process'); // System calls
let path = require('path'); // Paths
let color = {
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',