If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer.converter import TextConverter | |
from pdfminer.layout import LAParams | |
from pdfminer.pdfpage import PDFPage | |
from io import BytesIO | |
def pdf_to_text(path): | |
manager = PDFResourceManager() | |
retstr = BytesIO() | |
layout = LAParams(all_texts=True) |
<?php | |
function require_auth() { | |
$AUTH_USER = 'admin'; | |
$AUTH_PASS = 'admin'; | |
header('Cache-Control: no-cache, must-revalidate, max-age=0'); | |
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW'])); | |
$is_not_authenticated = ( | |
!$has_supplied_credentials || | |
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER || | |
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html><head> <!-- If you delete this tag, the sky will fall on your head --> <style type="text/css"> | |
/* ------------------------------------- | |
GLOBAL | |
------------------------------------- */ | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
* { |
# Usage: | |
# 1. Drop this file into lib/capistrano/submodule_strategy.rb | |
# 2. Add the following to your Capfile: | |
# require 'capistrano/git' | |
# require './lib/capistrano/submodule_strategy' | |
# 3. Add the following to your config/deploy.rb | |
# set :git_strategy, SubmoduleStrategy | |
module SubmoduleStrategy | |
# do all the things a normal capistrano git session would do |
#!/bin/bash | |
function jsonval { | |
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop` | |
echo ${temp##*|} | |
} | |
json=`curl -s -X GET http://twitter.com/users/show/$1.json` | |
prop='profile_image_url' | |
picurl=`jsonval` |
<?php | |
/** | |
* ----------------------------------------------------------------------------------------- | |
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php` | |
* ----------------------------------------------------------------------------------------- | |
*/ | |
// HTML Minifier | |
function minify_html($input) { |
<?php | |
class Db | |
{ | |
private $_connection; | |
private static $_instance; //The single instance | |
private $_host = DB_HOST; | |
private $_username = DB_USER; | |
private $_password = DB_PASSWORD; | |
private $_database = DB_DB; |
<?php | |
/* | |
* Mysql database class - only one connection alowed | |
*/ | |
class Database { | |
private $_connection; | |
private static $_instance; //The single instance | |
private $_host = "HOSTt"; | |
private $_username = "USERNAME"; | |
private $_password = "PASSWORd"; |
If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
##Deploy with Capistrano from Windows
Install Cygwin (http://www.cygwin.com/)
Download the RubyGems tarball from Ruby Forge (http://rubyforge.org/projects/rubygems/)
In a bash terminal, navigate to the unpacked directory and run: