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
{% macro example_2(one, two) %} | |
* {{one}} - {{two}} | |
* {{kwargs}} | |
{% endmacro %} | |
{{example_2(1, 2, test="Hello")}} |
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 shutil | |
import cx_Oracle | |
tns = cx_Oracle.makedsn("192.168.0.25",1521,'prod') | |
db = cx_Oracle.connect("user","123", tns) | |
def insertarFoto(archivo, codigo): | |
c = db.cursor() | |
sql = "INSERT INTO FARMA.IMAGENES (IMAG_CODIGO,PROD_CODIGO,TIIM_CODIGO,IMAG_OBJETO, empr_codigo) VALUES (farma.pk_gral.FL_SGTE_CODE_CONTROL('SQ_IMAG_CODIGO'),:cod_prod ,5,:blob, 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 shutil | |
import cx_Oracle | |
from PIL import Image | |
tns = cx_Oracle.makedsn("192.168.0.254",1521,'prod') | |
db = cx_Oracle.connect("drgg","melica", tns) | |
def insertarFoto(archivo, codigo): | |
c = db.cursor() |
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
public String convertDegreeToCardinalDirection(int directionInDegrees){ | |
String cardinalDirection = null; | |
if( (directionInDegrees >= 348.75) && (directionInDegrees <= 360) || | |
(directionInDegrees >= 0) && (directionInDegrees <= 11.25) ){ | |
cardinalDirection = "N"; | |
} else if( (directionInDegrees >= 11.25 ) && (directionInDegrees <= 33.75)){ | |
cardinalDirection = "NNE"; | |
} else if( (directionInDegrees >= 33.75 ) &&(directionInDegrees <= 56.25)){ | |
cardinalDirection = "NE"; | |
} else if( (directionInDegrees >= 56.25 ) && (directionInDegrees <= 78.75)){ |
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 mimerender | |
mimerender.register_mime('pdf', ('application/pdf',)) | |
mimerender = mimerender.FlaskMimeRender(global_charset='UTF-8') | |
def render_pdf(html): | |
from xhtml2pdf import pisa | |
from cStringIO import StringIO | |
pdf = StringIO() | |
pisa.CreatePDF(StringIO(html.encode('utf-8')), pdf) |
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
try{ | |
getApplicationContext().deleteDatabase("database.db"); | |
Log.w(TAG, "onCreate: Delete Database"); | |
} catch (Exception e){ | |
Log.w(TAG, "onCreate: ",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
#!/bin/bash | |
fuser -k 9090/tcp | |
nohup java -jar warehousetracker-1.0-SNAPSHOT.jar > logs.log 2>&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
# .bashrc | |
# User specific aliases and functions | |
alias rm='rm -i' | |
alias cp='cp -i' | |
alias mv='mv -i' | |
alias wsreset='/etc/init.d/glassfishDT restart' | |
alias gfreset='/etc/init.d/glassfish4D restart' |
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
private String getImei() { | |
try{ | |
return Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID); | |
}catch (Exception e ) { | |
return "(Desconocido)"; | |
} | |
} |
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
// delete duplicates (if any) from 'myArrayList' | |
arraylist = new ArrayList<String>(new LinkedHashSet<String>(arraylist)); |