This file contains 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
require 'rubygems' | |
require 'sequel' | |
require 'fileutils' | |
module Jekyll | |
module Drupal | |
QUERY = " | |
select n.nid node_id, | |
n.title post_title, |
This file contains 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 | |
/* | |
JSON list of all images files in current directory | |
*/ | |
$dir = "."; | |
$dh = opendir($dir); | |
$image_files = array(); |
This file contains 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
#!/bin/bash | |
# Run this on a new OS X installation | |
# Disable menu bar transparency | |
defaults write -g AppleEnableMenuBarTransparency -bool false | |
# Expand save panel by default | |
defaults write -g NSNavPanelExpandedStateForSaveMode -bool true | |
# Disable press-and-hold for keys in favor of key repeat |
This file contains 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
<exec executable="svn" spawn="false" dir="." outputproperty="revision.number"> | |
<arg line="info"/> | |
<redirector> | |
<outputfilterchain> | |
<linecontainsregexp><regexp pattern="^Last\sChanged\sRev:\s[0-9]*$" /></linecontainsregexp> | |
<tokenfilter> | |
<replaceregex pattern="^Last\sChanged\sRev:\s([0-9]*)$" replace="\1" flags="g" /> | |
</tokenfilter> | |
</outputfilterchain> | |
</redirector> |
This file contains 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
import os | |
print os.walk('.').next()[1] |
This file contains 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
import os | |
import errno | |
def pid_exists(pid): | |
"""Check whether pid exists in the current process table.""" | |
if pid < 0: | |
return False | |
try: | |
os.kill(pid, 0) | |
except OSError, e: |
This file contains 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
import urllib2 | |
import base64 | |
def fetch(url, username, password): | |
try: | |
request = urllib2.Request(url) | |
base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '') | |
request.add_header("Authorization", "Basic %s" % base64string) | |
return urllib2.urlopen(request).read() | |
except urllib2.HTTPError as ex: |
This file contains 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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:f="http://java.sun.com/jsf/core" | |
xmlns:h="http://java.sun.com/jsf/html" | |
xmlns:ui="http://java.sun.com/jsf/facelets" | |
xmlns:p="http://primefaces.org/ui" | |
xmlns:c="http://java.sun.com/jsp/jstl/core" | |
xmlns:pe="http://primefaces.org/ui/extensions"> | |
<h:head> |
This file contains 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/python | |
from __future__ import print_function | |
import string | |
import os | |
import sys | |
import re | |
import argparse | |
from subprocess import Popen, PIPE |
This file contains 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
<!DOCTYPE html> | |
<%@page import="org.springframework.web.context.WebApplicationContext"%> | |
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%> | |
<%@page import="org.apache.commons.dbcp.BasicDataSource" %> | |
<% | |
WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(application); | |
BasicDataSource dataSource = (BasicDataSource) context.getBean("dataSource"); | |
%> | |
<html> | |
<head> |
OlderNewer