Skip to content

Instantly share code, notes, and snippets.

@mgarciate
mgarciate / convert_png2jpeg.sh
Created March 20, 2017 15:12
Convert png to jpeg command line macos
for i in *.png; do sips -s format jpeg $i --out $OUTPUT_FOLDER/$i.jpeg;done
@mgarciate
mgarciate / rename_files.py
Created March 19, 2017 19:53
Rename files in directory replacing a given string and make the filename lowecase
import os
[os.rename(f, f.replace("OLD_VALUE", "NEW_VALUE").lower()) for f in os.listdir('.') if not f.startswith('.')]
@mgarciate
mgarciate / DateTimePickerEx1.cs
Last active January 12, 2017 10:38
Extend DateTimePicker to jump from 1 field to the next one. This code wasn't written by myself, can't remember the url.
using System;
using System.Windows.Forms;
namespace CW
{
public partial class DateTimePickerEx1 : DateTimePicker
{
#region Constructor
public DateTimePickerA4Ex1()
{
@mgarciate
mgarciate / MuteUnmuteMac
Created October 4, 2016 15:10
Mute mac for n seconds through Apple Script
//Code to mute and unmute macs for n seconds through Applescript Editor
set volume with output muted
set startDelayDate to (time of (current date))
global shouldRepeat
set shouldRepeat to yes
repeat while shouldRepeat is equal to yes
delay (1)
@mgarciate
mgarciate / MuteWindowsNSeconds.cs
Created October 4, 2016 15:01
Mute Windows for n seconds
//Mute Windows for n seconds
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;