Skip to content

Instantly share code, notes, and snippets.

View jappa's full-sized avatar

Jamil Appa jappa

View GitHub Profile
@jappa
jappa / s3_multipart_upload.py
Created July 23, 2012 20:32 — forked from fabiant7t/s3_multipart_upload.py
Parallel S3 multipart upload with retries
import logging
import math
import mimetypes
from multiprocessing import Pool
import os
from boto.s3.connection import S3Connection
from filechunkio import FileChunkIO
@jappa
jappa / gist:7890391
Created December 10, 2013 13:13 — forked from certik/gist:5723420
{
"metadata": {
"name": "VTK"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@jappa
jappa / TautozCFD.py
Created November 14, 2014 12:31
DLR Tau mesh to zCFD converter
"""
Copyright (c) 2014, Zenotech Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
@jappa
jappa / as
Last active August 29, 2015 14:18 — forked from xianyi/as
#!/bin/sh
HAS_INPUT_FILE=0
ARGS=$@
while [ $# -ne 0 ]; do
ARG=$1
# Skip options
if [ $ARG == "-arch" ] || [ $ARG == "-o" ]; then
# Skip next token
shift
shift
@jappa
jappa / ParseSlurm.py
Last active July 23, 2019 09:27
Parse slurm accounting output
from datetime import timedelta
import sys
import os
import re
import math
from subprocess import Popen, PIPE, check_output
def get_timedelta(date_str):
# Returns timedelta object from string in [DD-[hh:]]mm:ss format
days = 0
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
syntax on
augroup resCur
autocmd!
autocmd BufReadPost * call setpos(".", getpos("'\""))
augroup END
@jappa
jappa / integer_sequence.hpp
Last active February 5, 2023 00:24
A C++11 implementation of std::integer_sequence from C++14
#ifndef ___KOS_UTILITY_INTEGER_SEQUENCE__82DDD139689B8D73C15C6165472A8E14_HPP__
#define ___KOS_UTILITY_INTEGER_SEQUENCE__82DDD139689B8D73C15C6165472A8E14_HPP__
#include <type_traits>
#include <kos/namespaces.hpp>
KOS_BEGIN_HEADER
KOS_BEGIN_NAMESPACE
// A C++11 implementation of std::integer_sequence from C++14
template <typename T, T... N>
@jappa
jappa / custom.js
Created June 22, 2016 20:30
.jupyter/custom/custom.js used to hide code cells
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
@jappa
jappa / dmesg.py
Last active June 30, 2016 10:54
Converts dmesg time stamp to human readable form
#!/usr/bin/env python
# coding=utf8
# Copyright (C) 2010 Saúl ibarra Corretgé &lt;saghul@gmail.com&gt;
#
"""
pydmesg: dmesg with human-readable timestamps
"""