This file contains hidden or 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
/* | |
* Android API Guide | |
* http://developer.android.com/guide/topics/ui/actionbar.html | |
* Android Design Guide | |
* http://developer.android.com/design/patterns/actionbar.html | |
* Titanium Mobile will support someday | |
* https://jira.appcelerator.org/browse/TIMOB-2371 | |
*/ | |
var osName = Ti.Platform.osname, | |
isAndroid = osName==='android', |
This file contains hidden or 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
<VirtualHost *> | |
ServerName example.com | |
WSGIDaemonProcess www user=max group=max threads=5 | |
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi | |
<Directory /home/max/Projekte/flask-upload> | |
WSGIProcessGroup www | |
WSGIApplicationGroup %{GLOBAL} | |
Order deny,allow |
This file contains hidden or 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/env python | |
# | |
# Converts any integer into a base [BASE] number. I have chosen 62 | |
# as it is meant to represent the integers using all the alphanumeric | |
# characters, [no special characters] = {0..9}, {A..Z}, {a..z} | |
# | |
# I plan on using this to shorten the representation of possibly long ids, | |
# a la url shortenters | |
# |
This file contains hidden or 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
/** | |
* Merge a list of files into another one | |
* | |
* @param files | |
* @param mergedFile | |
* @throws IOException | |
*/ | |
public static void mergeFiles(List<File> files, File mergedFile) { | |
if (mergedFile.exists()) { |
This file contains hidden or 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
public static void gzipFile(String source, String destination, boolean delete) { | |
try { | |
FileInputStream fis = new FileInputStream(source); | |
FileOutputStream fos = new FileOutputStream(format("%s.gz", destination)); | |
GZIPOutputStream gzipOS = new GZIPOutputStream(fos); | |
byte[] buffer = new byte[1024]; | |
int len; |
This file contains hidden or 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 java.io.BufferedReader; | |
import java.io.DataOutputStream; | |
import java.io.InputStreamReader; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.nio.charset.Charset; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class RESTClient { |
This file contains hidden or 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
/* | |
* (value) could be (value|tag|name) or whatever is the key on json string | |
*/ | |
public static String getValueFromJson(String json) { | |
String value = ""; | |
Pattern p = Pattern.compile("\"(value)\":\"((\\\\\"|[^\"])*)\""); | |
Matcher m = p.matcher(json); | |
if (m.find() && m.groupCount() > 1) { |
This file contains hidden or 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
-- First setup Vertica node. | |
-- When it's up'n'running launch from vsql: | |
CREATE SUBNET my_subnet with '192.168.0.0'; -- IP of your subnet may differs | |
-- The above statement creates a subnet between Vertica main clusters and the Vertica node. | |
-- NOTE: they must be in the same network | |
ALTER DATABASE VERTICA_DB EXPORT ON my_subnet; |
This file contains hidden or 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
When: ERROR: Join inner did not fit in memory ... | |
$ vsql | |
dbadmin=> select set_vertica_options('EE','ENABLE_JOIN_SPILL'); | |
set_vertica_options | |
-------------------------------------------------------------- | |
EE Vertica Options | |
-------------------- |
This file contains hidden or 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 smtplib | |
from email.mime.text import MIMEText | |
msg = MIMEText('There was a terrible error that occured and I wanted you to know!') | |
msg['Subject'] = 'Hello world' | |
msg['From'] = '[email protected]' | |
msg['To'] = '[email protected]' | |
username = 'mailtrap.io username' | |
password = 'mailtrap.io password' |