Skip to content

Instantly share code, notes, and snippets.

@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 2, 2024 22:20
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@metal3d
metal3d / threadpool.py
Last active December 15, 2017 04:04
ThreadPool is an asynchrone Pool thread that doesn't block when adding a thread to Queue.
# -*- encoding: utf-8 -*-
""" threadpool module, export ThreadPool class that is a non blocking
Thread Queue. Most important is that ThreadPool.add_task runs
asychroniousally. This method doesn't block process.
Example:
p = ThreadPool(2)
p.add_task(f1, arg1, arg2, test=False)
p.add_task(f1, arg2, arg3, test=False)
p.add_task(f1, arg4, arg5, test=True)
@fedesilva
fedesilva / kaboom
Created February 22, 2014 14:03
spark+es-hadoop: UTFDataFormatException
java.io.UTFDataFormatException
at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2157)
at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:2000)
at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:866)
at org.elasticsearch.hadoop.mr.EsInputFormat$ShardInputSplit.write(EsInputFormat.java:109)
at org.apache.hadoop.io.ObjectWritable.writeObject(ObjectWritable.java:197)
at org.apache.hadoop.io.ObjectWritable.writeObject(ObjectWritable.java:123)
at org.apache.hadoop.io.ObjectWritable.write(ObjectWritable.java:79)
at org.apache.spark.SerializableWritable.writeObject(SerializableWritable.scala:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
@rothgar
rothgar / install-tmux
Last active April 5, 2023 06:53 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
@Slinkkay
Slinkkay / crashlytics_scraper
Last active April 29, 2016 07:40
Crashlytics User Scraper
// ==UserScript==
// @name Crashlytics ID Scraper
// @namespace http://your.homepage/
// @version 0.1
// @description A console logger which outputs the user name for each issue and then presses next
// @author You
// @match https://crashlytics.com/*/*/apps/*/issues/*
// @grant none
// ==/UserScript==
@bradkarels
bradkarels / chill.scala
Created April 30, 2015 19:34
Spark Chill Example
import java.io.ByteArrayOutputStream
import java.io.ObjectOutputStream
import java.io.Serializable
import com.twitter.chill.{Input, Output, ScalaKryoInstantiator}
class Person extends Serializable {
var name: String = ""
def this(name:String) {
this()
@MehulATL
MehulATL / cards.css
Created May 12, 2015 19:57
ionic cards css
.card, .list-inset {
overflow: hidden;
margin: 20px 10px;
border-radius: 2px;
background-color: #fff; }
.card {
padding-top: 1px;
padding-bottom: 1px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
---
title: "Codebook template"
author: "Your name here"
date: "The date here"
output:
html_document:
keep_md: yes
---
## Project Description
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 13:48
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites