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
set -x | |
for qwer in *.{jpg,gif,png}/; | |
do | |
if [[ "$qwer" != "*"* ]] ; then | |
echo "$qwer"; | |
mv "$qwer" "_BCK${qwer}" | |
cat "_BCK${qwer}" > "${qwer}" | |
fi | |
done | |
set +x |
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
<!-- Properties --> | |
<slf4jVersion>1.6.1</slf4jVersion> | |
<!-- Dependencies --> | |
<dependency> | |
<groupId>org.slf4j</groupId> | |
<artifactId>slf4j-api</artifactId> | |
<version>${slf4jVersion}</version> | |
</dependency> |
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
################################################################################ | |
# Enumerations in Python | |
################################################################################ | |
def enum(*sequential, **named): | |
enums = dict(zip(sequential, range(len(sequential))), **named) | |
reverse = dict((value, key) for key, value in enums.iteritems()) | |
enums['reverse_mapping'] = reverse | |
return type('Enum', (), enums) |
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
$filename(json,utf-8){ | |
"songs": '[' | |
$loop(%_filename_ext%) { | |
"title": "%title%", | |
"album": "%album%", | |
"artist": "%artist%", | |
"album_artist": "%albumartist%", | |
"composer": "$meta(composer,1)", | |
"publisher": "%publisher%", | |
"genre": $meta("%genre%",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
-- ----------------------------------------------------------------------------- | |
-- SQLPlus dump setup file | |
-- Jesús Moreno Amor <[email protected]> | |
-- May 2012 | |
-- | |
-- Execute: | |
-- sqlplus -S user/password@database @DumpSetup.sql RealQuery.sql | |
-- ----------------------------------------------------------------------------- | |
-- SQLPlus session configuration |
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
with open("downloaded_file.html", 'w') as file: | |
file.write(requests.get('http://www.example.com').content) |
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
# All the magic comes from the requests library http://www.python-requests.org | |
import requests | |
# URI of the resource we want to download | |
FILE_URI = 'http://www.example.com' | |
# Path to the local file where we will save the remote resource | |
FILE_NAME = 'downloaded_file.html' | |
# Chunk size that we will keep in memory, in bytes |
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
#!/bin/bash | |
JAR=$1.jar | |
unzip -d $JAR.tmp $JAR | |
pushd $JAR.tmp | |
for f in `find . -name '*.class'`; do | |
jad -d $(dirname $f) -s java -lnc $f | |
done | |
popd |
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
// Inline | |
StringWriter sw = new StringWriter(); | |
e.printStackTrace(new PrintWriter(sw)); | |
String exceptionAsStrting = sw.toString(); | |
// Function | |
public String stackTraceToString(Throwable e) | |
{ | |
StringBuilder sb = new StringBuilder(); | |
for (StackTraceElement element : e.getStackTrace()) |
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
package com.morenoamor.tutorials; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.Properties; | |
/** | |
* Properties file reading and writing example |
NewerOlder