Skip to content
View trace.php
function trace()
{
echo '<pre>';
var_dump(debug_backtrace());
echo '</pre>';
exit;
}
View go_test_coverage.sh
#!/bin/sh
PACKAGE=mypkg
# set mode
go test -coverprofile=coverage.out $PACKAGE
go tool cover -func=coverage.out
go tool cover -html=coverage.out
# count mode
View log.go
func log(s ...interface{}) {
f, err := os.OpenFile("info.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
fmt.Printf("error opening log file: %v", err)
os.Exit(1)
}
defer f.Close()
log.SetOutput(f)
ss := ""
for _, p := range s {
View ledstest.py
#!/usr/bin/env python3
import time
import RPi.GPIO as GPIO
GPIO.setmode( GPIO.BCM )
ENABLE = 1; DISABLE = 0
RED = 23; GREEN = 24; BLUE = 25
View pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
View gist:7672715
alias ls='ls -ah --color=always'
alias ll='ls -lavh --color=always'
alias cp='cp -i'
alias vi='/usr/bin/emacs'
alias ..='cd ..'
alias ...='cd ../..'
Black="\[\033[0;30m\]"
DarkGray="\[\033[1;30m\]"
LightGray="\[\033[0;37m\]"
View .muttrc
# basic .muttrc for use with Gmail
# Change the following six lines to match your Gmail account details
set imap_user = "username@gmail.com"
set imap_pass = ""
set smtp_url = "smtp://username@smtp.gmail.com:587/"
set smtp_pass = ""
set from = "username@gmail.com"
set realname = "Firstname Lastname"
#
View file1.py
#!/usr/bin/env python
DB_NAME = "my_db"
from subprocess import Popen, PIPE
import re
exclude = [ 'tablename', 'rows' ]
tp = re.compile( '[^a-z_]' )
ts = Popen( [ "/usr/bin/psql", DB_NAME, "-c SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg_%' AND tablename NOT LIKE 'sql_%' ORDER BY tablename" ], stdout=PIPE ).communicate()[ 0 ].split( ' ' )
Something went wrong with that request. Please try again.