Instantly share code, notes, and snippets.

View packages.list
ack
axel
curl
emacs
git
htop
jq
mc
network-manager
pandoc
View macro.vba
' Run the SaveAllAsCSV subroutine.
' Creates a CSV file from the active sheet under the given directory.
'
' Based on https://forum.openoffice.org/en/forum/viewtopic.php?t=41284
sub SaveAsCSV(filename As String)
' Declare the document variable:
dim document as object
' Get the document:
View sample.pl
#!/usr/bin/env perl
=head1 NAME
sample.pl - Sample Perl Script
=head1 SYNOPSIS
perl sample.pl
perldoc sample.pl
View casts.py
"""
Provides a cast operations module.
>>> cast_to_decimal(1.0001)
Decimal('1.0001')
>>> cast_to_decimal(1)
Decimal('1')
>>> cast_to_decimal("1.0001")
Decimal('1.0001')
>>> cast_to_decimal(Decimal("1.0001"))
View setup.py
"""
Provides the setup module.
"""
from ___YOURMODULE___ import __version__
from setuptools import setup
from setuptools import find_packages
import os
## The absolute directory path:
View currencies.py
from enum import Enum
from decimal import Decimal
class Currency:
"""
Defines an ISO 4217 compatible currency object model.
>>> Currency("XXX", "My Currency", 2)
<Currency XXX 2 My Currency>
View multiplicity.py
from enum import Enum
from math import inf
class Multiplicity(Enum):
"""
Defines multiplicities.
>>> Multiplicity.OPTIONAL.min
0
View SampleRenjinGRE.java
import org.moeaframework.core.Algorithm;
import org.moeaframework.core.Solution;
import org.moeaframework.core.spi.AlgorithmFactory;
import org.moeaframework.core.variable.Grammar;
import org.moeaframework.problem.AbstractProblem;
import org.moeaframework.util.grammar.ContextFreeGrammar;
import org.moeaframework.util.grammar.Parser;
import org.renjin.sexp.SEXP;
import javax.script.ScriptEngine;
View bitbackup.py
from collections import OrderedDict
import base64
import json
import urllib2
import sys
import datetime
## Define Bitbucket API endpoints:
ENDPOINT_REPOSITORIES = "https://api.bitbucket.org/2.0/repositories/{handle}?page={page}"
View changelog.sh
#!/bin/bash
########################################################################
# Description:
# Produces custom ChangeLog file contents out of the "git log"
#
# Usage:
# sh changelog.sh
#
# Usage (Save output):