This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import json | |
import logging | |
from sqlalchemy import create_engine | |
from sqlalchemy import types | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.sql.schema import MetaData, Table | |
from sqlalchemy import Column, Integer |
This file contains hidden or 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
# -*- coding: utf-8; -*- | |
from tigger import app | |
app.ready() | |
from tigger import db | |
def decorate_timestamps(): | |
from datetime import datetime | |
from sqlalchemy import TIMESTAMP, Column, text |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
class {{ table.name }}: | |
__tablename__ = '{{ table.name }}' | |
{% for col in table.columns %} | |
{{ col.name }} = Column({{col.type}}{% if col.primary_key %}, primary_key=True{% endif%}{% if not col.nullable %}, nullable=False{% endif %}) | |
{% endfor -%} |
This file contains hidden or 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/python3 | |
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import shlex | |
import sys | |
import subprocess | |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import re | |
import sys | |
with open('/proc/net/tcp') as f: | |
lineno = 0 | |
sockets = [] | |
for line in f: | |
lineno += 1 | |
if lineno == 1: |
This file contains hidden or 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
package net.momoka; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
/** | |
* Hello world! | |
* | |
*/ |
This file contains hidden or 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
<?php | |
// I know, I know, there are proc_open, exec, system functions to use. | |
// But they just suck... | |
// So I wrote this, hope this will help ourselves out :3 | |
function subprocess($cmd, $login = FALSE, $cwd = './', | |
$shell = '/bin/bash', $pipespec = NULL) { | |
$pid = getmypid(); |
This file contains hidden or 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
package net.momoka; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import com.fasterxml.jackson.annotation.JsonAutoDetect; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.databind.SerializationFeature; |
This file contains hidden or 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
export LDFLAGS="-Wl,-z,relro,-z,now" | |
mk_add_options PYTHON=/usr/bin/python2 | |
mk_add_options AUTOCONF=autoconf-2.13 | |
mk_add_options MOZ_MAKE_FLAGS="-j8" | |
export MOZ_JEMALLOC=1 | |
ac_add_options --host=x86_64-pc-linux-gnu | |
ac_add_options --target=x86_64-pc-linux-gnu |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import sys | |
## It seems that locale will always be C(ascii) when | |
## mutt call this script via mailcap | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
from icalendar import Calendar | |
import pytz |