Skip to content

Instantly share code, notes, and snippets.

@tnmt
tnmt / wp-xml-octopress-import.rb
Created November 15, 2011 12:31
Import XML of Wordpress to Octopress
# -*- coding: utf-8 -*-
require 'fileutils'
require 'date'
require 'yaml'
require 'uri'
require 'rexml/document'
include REXML
doc = Document.new File.new(ARGV[0])
@yorkxin
yorkxin / wordpressdotcom.rb
Created November 25, 2011 18:29
Wordpress.com (XML export) to Octopress importer. See http://git.io/x8yapw for change notes.
# coding: utf-8
# Original File: https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# Modified by Yu-Cheng Chuang <ducksteven@gmail.com>
# Licensed under MIT License (same as the original file)
# This version of wordpressdotcom.rb is compatible
# with the real-world Wordpress.com export file, which:
#
# - Makes paragraphs (<p>) and line breaks (<br>)
@zellux
zellux / migrate.rb
Created November 29, 2011 03:10
Migrate from wordpress to octopress
# coding: utf-8
require 'rubygems'
require 'hpricot'
require 'fileutils'
require 'time'
require 'ya2yaml'
require File.join(File.dirname(__FILE__), "downmark_it")
require 'nokogiri'
require 'cgi'
@lucifr
lucifr / Code added to _config.yml
Created December 2, 2011 04:41
Flickr aside for Octopress
# Flick Badges
# Find your user id here: http://idgettr.com/ It should be something like "25711589%40N00".
flickr_user: 25711589%40N00
flickr_count: 6
@juniorz
juniorz / import.rb
Created January 5, 2012 10:15 — forked from ngauthier/import.rb
Import a blogger archive to jekyll (octopress version)
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
@cdwilson
cdwilson / setup_apc_ups.sh
Created July 7, 2012 19:55
Setup APC USB UPS on Ubuntu
#!/bin/sh
# https://help.ubuntu.com/community/apcupsd
# don't actually run this
exit 0
# install apcupsd
sudo apt-get -y install apache2 apcupsd apcupsd-cgi
@jordanbaucke
jordanbaucke / bitfinex-python.py
Created June 19, 2013 06:16
Python example code for an authenticated call to Bitfinex API v1
import requests # pip install requests
import json
import base64
import hashlib
import time #for nonce
api_key = ''
api_secret = ''
#url = 'https://bitfinex.com/api/v1/order/new'
@cboettig
cboettig / docker-compose.yml
Last active December 31, 2023 15:23
debugging NGINX configuration for Jupyter
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter
@mrw34
mrw34 / postgres.sh
Last active March 26, 2024 00:24
Enabling SSL for PostgreSQL in Docker
#!/bin/bash
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
test $(uname -s) = Linux && chown 70 server.key
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
@QuantBits
QuantBits / script.js
Created February 8, 2019 17:55
BitMex USD Converter - For TemperMonkey
// ==UserScript==
// @name BitMex USD Converter
// @namespace https://bitmex.com/
// @version 0.11
// @description Get some sanity into your gambling.
// @author koinkraft
// @grant none
// @include https://bitmex.com/*
// @include https://www.bitmex.com/*
// @require https://code.jquery.com/jquery-2.1.4.min.js