Skip to content

Instantly share code, notes, and snippets.

View ShadowKyogre's full-sized avatar

ShadowKyogre

View GitHub Profile
@ShadowKyogre
ShadowKyogre / predict_voc.py
Last active September 20, 2015 00:09
Swisseph routine to calculate VoC. Pardon me for being lazy for not copypastaing the functions from chronoslnx that it's using in here
from chronoslnxlib.core import *
def predict_voc(cur_date):
cycles = date_to_moon_cycles(cur_date)
moon_pos = swisseph.calc_ut(datetime_to_julian(cur_date), swisseph.MOON)[0]
closest_sign = (( moon_pos // 30 ) + 1) * 30
lower_sign = ( moon_pos // 30 ) * 30
#print(moon_pos, closest_sign)
lower_cycles = cycles+(angle_sub(lower_sign, moon_pos)/360)
cycles += (closest_sign - moon_pos) / 360
#!/bin/bash
if [[ -z $@ ]]; then
echo 'packages list is missed'
echo 'run ./import-to-aur4.sh pack1 pack2 pack3'
exit
fi
mkdir aur4
cd aur4
@ShadowKyogre
ShadowKyogre / dkms
Created June 3, 2015 20:35
OpenRC services
#!/usr/bin/openrc-run
depend() {
need localmount
after net
}
start() {
/usr/lib/systemd/scripts/dkms start
}
@ShadowKyogre
ShadowKyogre / gen_article_names.py
Created February 17, 2015 04:03
Written in Python 3. This scrapes article names that're all the OCG cards available in YGO so far. Will need to make this more modular to pull article names from any site's categories later.
from lxml import etree
cards="http://yugioh.wikia.com/api.php?format=xml&action=query&list=categorymembers&cmtitle=Category:OCG_cards&cmprop=title&cmlimit=5000"
ignore=set(["List of unnamed cards", "List of unseen cards"])
cmcontinue=""
titles=[]
querycount=1
#!/usr/bin/env python
"""
ODT2PANDOC
==========
ODT2PANDOC is a slight variant of ODT2TXT. Right now, the only differences are that it generates ATX style headers and uses *asterisks* for italics, neither of which is in any way specific to pandoc's extended markdown.
ODT2TXT
=======
@ShadowKyogre
ShadowKyogre / bookmarksjson2xml.py
Last active August 29, 2015 14:06
Converts (firefox?) bookmark json format to a KeePassX compatible XML for importing.
import os
import json
#import uuid
from urllib.parse import urlparse
import xml.etree.ElementTree as ET
from datetime import datetime, timedelta
#http://stackoverflow.com/questions/12589952/convert-microsecond-timestamp-to-datetime-in-python
epoch = datetime(1970, 1, 1)
@ShadowKyogre
ShadowKyogre / carousel-colors.css
Last active August 29, 2015 14:01
Experimental mobile theme. Also includes some carousel code that can be easily accessed with a thumb.
@ShadowKyogre
ShadowKyogre / PKGBUILD
Created March 26, 2013 22:13
Updated PKGBUILD and patch to make lp work for printing
# Contributer: giacomogiorgianni@gmail.com
pkgname=pdfviewer
pkgver=0.7
pkgrel=3
pkgdesc="Lightweight Qt-only PDF viewer"
arch=('i686' 'x86_64')
url="http://opendesktop.org/content/show.php/Pdf+Viewer?content=149637"
license=('GPL')
depends=('qt4' 'poppler-qt')
@ShadowKyogre
ShadowKyogre / add_text_and_page_bg_config.patch
Last active December 10, 2015 21:58
Since the colors white for the bg and black for the text are hard coded, I decided to switch around some things in order to make thos colors configurable.
diff -aur openastro.org-1.1.38.orig/openastro openastro.org-1.1.38/openastro
--- openastro.org-1.1.38.orig/openastro 2013-01-09 16:45:06.459729587 -0800
+++ openastro.org-1.1.38/openastro 2013-01-09 17:50:34.637738525 -0800
@@ -49,7 +49,10 @@
VERSION='1.1.38'
#directories
-DATADIR=os.path.join(sys.prefix,'share','openastro.org')
+if LOCAL:
+ DATADIR=os.path.dirname(__file__)
@ShadowKyogre
ShadowKyogre / getpython.sh
Created January 7, 2013 07:06
Bored, so I wrote this possibly pointless script. Basically, it takes input arguments like this: getpython.sh 3 0 3
#!/bin/sh
for i in $(seq "$2" "$3")
do
which "python${1}.${i}" && exit 0
done
which "python${1}" || echo "$PYTHONBIN"