This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################################### | |
# A handy starting point if you need to setup something that only fires on x # | |
# days of the week. # | |
############################################################################### | |
DAYNUM=$(date +"%u") | |
if [ $DAYNUM -eq 1 ]; then | |
echo "It's Monday" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Usage: {script} [ OPTIONS ] TARGET VERSION | |
# | |
# TARGET Default target is "/usr/local". | |
# VERSION If not defined tries to get the build into the Sublime Text 2 website. | |
# | |
# OPTIONS | |
# | |
# -h, --help Displays this help message. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.BorderLayout; | |
import java.awt.Container; | |
import javax.swing.JEditorPane; | |
import javax.swing.JFrame; | |
import javax.swing.JScrollPane; | |
import javax.swing.WindowConstants; | |
import jsyntaxpane.DefaultSyntaxKit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for song in *.mp4 | |
do | |
title=`echo "$song" | sed -e "s/.mp4$//g"` | |
ffmpeg -i "$song" -vn -ar 44100 -ac 2 -ab 192k -f mp3 "$title.mp3" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
import org.python.core.*; | |
import org.python.util.PythonInterpreter; | |
public class Document extends JFrame implements ActionListener | |
{ | |
private JTextArea ta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import subprocess | |
def sendmessage(message): | |
subprocess.Popen(['notify-send', message]) | |
return | |
sendmessage('Hello OSD This is my first programmatic OSD notification') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestOSD { | |
public static void main(String[] args) throws Exception{ | |
String[] cmd = { "/usr/bin/notify-send", | |
"-t", | |
"10000", | |
"Hello OSD This is my first programmatic OSD notification"}; | |
System.out.println("This is said : Hello OSD"); | |
Runtime.getRuntime().exec(cmd); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ | |
import com.jcraft.jsch.*; | |
import java.awt.*; | |
import javax.swing.*; | |
import java.io.*; | |
import java.util.Scanner; | |
public class cmdExec{ | |
public static void main(String[] arg){ | |
try{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from datetime import datetime, timedelta | |
import sys | |
def timeFormatted(hoursNum): | |
ftime = datetime.now() + timedelta(hours=hoursNum) | |
return '{:%H:%M:%S}'.format(ftime) | |
elapse = 8 | |
for n, i in enumerate(sys.argv): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start_row = 0 | |
while True: | |
cursor = conn.cursor() | |
cursor.execute("SELECT item FROM items LIMIT %d,1000" % start_row) | |
rows = cursor.fetchall() | |
if not rows: | |
break | |
start_row += 1000 |