Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
for file in $1/*.mp3
do
echo "file=$file"
mp3splt -f 0.10 5000.0 $file
if test "$?" == "0"; then
# cp $file $file"_backup"
rm $file
@linuxbender
linuxbender / DatTime.cs
Created May 3, 2011 08:44
C# DateTime convert to Type double or long example and back to DateTime
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DateTimeLongCompare
{
class Program
{
static void Main(string[] args)
@linuxbender
linuxbender / .bash_profile
Created May 11, 2011 12:28
SSH with plink (putty) = remote send linux command
if [[ $- != *i* ]] ; then
ON_A_TTY=No
else
ON_A_TTY=Yes
fi
# check that an ssh-agent is running
if [ -x /usr/bin/ssh-agent ]
then
SSH_AGENT_PID=-1
@linuxbender
linuxbender / HerokuTemplate.t4
Created October 8, 2011 21:43
Read DataAnnotations values from the enity
<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #>
<#@ Output extension="txt" #>
<#@ assembly name="System.ComponentModel.DataAnnotations" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Data.Entity" #>
<#@ assembly name="System.Data.Linq" #>
<#@ import namespace="System" #>
<#@ import namespace="System.Collections" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.ComponentModel.DataAnnotations" #>
@linuxbender
linuxbender / Linq - C
Created April 29, 2011 09:42
Linq and SQL - group max date - show latest entry - example
// http://creativecommons.org/licenses/by-nc-sa/3.0/
var foo = from p in _db.tblFactories
group p by p.tblFactoryName into grp
let tblFactoryExportDate = grp.Max(p => p.tblFactoryExportDate)
let tblFactoryName = grp.Key
from p in grp
where p.tblFactoryName == tblFactoryName &&
p.tblFactoryExportDate == tblFactoryExportDate
@linuxbender
linuxbender / ByteInfoAttribute.cs
Created January 12, 2012 23:39
EF 4.2 - MVC 3 - File Validation
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
namespace demo_002.Models
{
public class ByteInfoAttribute : ValidationAttribute
{
@linuxbender
linuxbender / core.css
Created December 31, 2012 01:44
Javascript: ScrollToTop
.topLink {
background: url('http://jquerymobile.com/demos/1.2.0/docs/toolbars/glyphish-icons/88-beermug.png') no-repeat;
position:fixed;
width: 30px;
height: 30px;
bottom:30px;
right:20px;
}
//
// FuncDemos
//
// Extensens.cs - 06.12.2012
//
// Author: glenn
using System;
using System.Net;
@linuxbender
linuxbender / LessImportResolver.cs
Created September 20, 2012 12:38
LessMinify.cs
using System.IO;
using System.Web;
using System.Web.Hosting;
using dotless.Core.Input;
namespace theForce.App_Start
{
public class LessImportResolver : IPathResolver
{
private string _currentFileDirectory;
foo.slice(0, foo.length - (foo.length - baa.length))