Skip to content

Instantly share code, notes, and snippets.

View muzicstation's full-sized avatar

tsumagana muzicstation

View GitHub Profile
@codingjester
codingjester / xauth.py
Created October 19, 2011 15:59
Using XAuth for Tumblr
#!/usr/bin/env python
import urllib
import urlparse
import oauth2 as oauth
@jamesadney
jamesadney / pil_to_pyglet.py
Created March 4, 2012 08:28
Load pyglet image from PIL
temp_image = Image.open("picture.png")
raw_image = temp_image.tostring()
image = pyglet.image.ImageData(width, height, 'RGB', raw_image, pitch= -resized_x * 3)
@dmkash
dmkash / br.sh
Created April 10, 2012 22:44
Shell Script for tmux setup
#!/bin/sh
SESSION_NAME="big_red"
cd ~/Sites/within3/big_red
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then
@bert2002
bert2002 / postwordpress.pl
Created August 6, 2012 12:43
publish article to a wordpress blog using XMLRPC interface. Uploading a picture and setting this as a featured image. Additionally add custom fields.
#!/usr/bin/perl
# script: publish article to a wordpress blog using XMLRPC interface. Uploading a picture and setting this as a featured image. Additionally add custom fields.
# author: <bert2002>
use strict;
use utf8;
use XMLRPC::Lite;
use IO::Socket::SSL;
my ($buf,$contents);
@creaktive
creaktive / mojo-crawler.pl
Last active November 28, 2020 13:15
Simple web crawler/scraper implemented using Mojolicious
#!/usr/bin/env perl
use 5.010;
use open qw(:locale);
use strict;
use utf8;
use warnings qw(all);
use Mojo::UserAgent;
# FIFO queue
@maddievision
maddievision / callback.md
Last active August 8, 2023 14:43
callback - A simple small module for Pythonista (http://omz-software.com/pythonista) which aims to make an easy callback URL handling & argument passing system.

callback

A simple small module for Pythonista (http://omz-software.com/pythonista) which aims to make an easy callback URL handling & argument passing system.

Usage

  1. import callback
  2. Create a handler instance handler = callback.InfoHandler(sys.argv)
  3. Decorate command handlers with @handler.cmd(cmdname)
  4. Call handler.handle() (and if it returns False, there was nothing to handle!)
@diogopms
diogopms / videoinfo.js
Last active October 30, 2023 18:24
Get video information using ffprobe and url
var exec = require('child_process').exec
var url = 'https://URL'
var command =
'curl --silent ' + url + '| ffprobe pipe:0 -print_format json -show_format'
exec(command, function callback (error, stdout, stderr) {
if (stderr.indexOf('Invalid data') > -1) {
console.error('Error!')
}
@mokejp
mokejp / rokuyo.py
Last active November 15, 2023 10:57
六曜の処理 python
# -*- coding: utf-8 -*-
from datetime import date, timedelta
# 六曜リスト
ROKUYO_TABLE = ['大安', '赤口', '先勝', '友引', '先負', '仏滅']
# 月別六曜開始位置リスト
ROKUYO_MONTH = [2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1]
# 新暦→旧暦の変換テーブル
@rosstimson
rosstimson / Dockerfile
Created October 13, 2015 20:37
Easily get ffmpeg on Fedora with support for all the things.
# Dockerfile for ffmpeg with pretty much support for everything as per:
# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
# includes codecs with weird licensing like MP3 and AAC.
#
FROM fedora
MAINTAINER Ross Timson <ross@rosstimson.com>
# Install build requirements.
RUN dnf install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
@Integralist
Integralist / Python3 HTTP Server.py
Last active May 2, 2024 12:35
Python3 HTTP Server.py
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
HOST_NAME = 'localhost'
PORT_NUMBER = 9000
class MyHandler(BaseHTTPRequestHandler):
def do_HEAD(self):
self.send_response(200)