Skip to content

Instantly share code, notes, and snippets.

View dually8's full-sized avatar

CJ Coffey dually8

View GitHub Profile
@dually8
dually8 / flac-to-aac.sh
Created July 13, 2021 02:14
ffmpeg convert flac to aac
# Assuming using fish shell
find ./ -iname '*.flac' | xargs -I '{}' basename '{}' '.flac' | xargs -I '{}' ffmpeg -i '{}'.flac -c:a aac -b:a 320k '{}'.m4a
@thomastay
thomastay / prompt.ps1
Last active April 3, 2023 15:00
Powershell fish prompt
function replaceHome($pathArray) {
# Check whether the first three paths are equal to HOME
# If it is, it substitutes it for ~
# Change this accordingly, if your home path is more than three
# paths long.
$splitChar = [System.IO.Path]::DirectorySeparatorChar
if ( ($pathArray.Length -gt 2) -and
(($pathArray[0..2] -join $splitChar) -eq $HOME)) {
@("~") + $pathArray[3..$pathArray.Length]
}
@thevangelist
thevangelist / my-component.spec.js
Created August 4, 2016 13:06
The only React.js component test you'll ever need (Enzyme + Chai)
import React from 'react';
import { shallow } from 'enzyme';
import MyComponent from '../src/my-component';
const wrapper = shallow(<MyComponent/>);
describe('(Component) MyComponent', () => {
it('renders without exploding', () => {
expect(wrapper).to.have.length(1);
});
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active July 18, 2024 05:36
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@TheZoc
TheZoc / mp3-to-m4r.bat
Created June 25, 2015 02:51
Convert a MP3 file to an Apple iPhone's ringtone file (M4R), using FFMPEG.
@echo off
rem =====================================================
rem Converts a MP3 file to a M4R file using ffmpeg.
rem Usage: Drop a MP3 file at the top of this batch file.
rem =====================================================
set ffmpeg_exe="C:\ffmpeg\ffmpeg-20150619-git-bb3703a-win64-static\bin\ffmpeg.exe"
rem %~f1 = Full File Path, with drive letter
rem %~p1 = Drive Letter
rem %~p1 = Path Only
@protrolium
protrolium / ffmpeg.md
Last active July 23, 2024 06:07
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@iMokhles
iMokhles / How to open iOS application from WatchKit
Created April 21, 2015 18:49
is a simple trick to open iOS application and even a page within the application from WatchKit
/*
//
// How to open iOS application using WatchKit
//
// Created by Mokhlas Hussein on 09/04/15.
// Copyright (c) 2015 iMokhles (Mokhlas Hussein). All rights reserved.
//
*/
/******* Within the App Watch Extension *******/
@JustinMcNamara74
JustinMcNamara74 / UserPermissions.sql
Last active May 1, 2024 21:49
#MSSQL List all user permissions/roles for all users
/*
********************************************************************************************************************************
Credits: @Jeremy
Posted: http://stackoverflow.com/questions/7048839/sql-server-query-to-find-all-permissions-access-for-all-users-in-a-database
********************************************************************************************************************************
Security Audit Report
1) List all access provisioned to a sql user or windows user/group directly
2) List all access provisioned to a sql user or windows user/group through a database or application role
3) List all access provisioned to the public role
@floriankugler
floriankugler / gist:6870499
Last active September 29, 2023 15:56
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
NSURLConnection | NSURLSession
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| N