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
.center { | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
text-align: center; | |
min-height: 100vh; | |
} |
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 static void showIndefiniteSnackBar(View view, String message){ | |
final Snackbar snack = Snackbar.make(view, message, Snackbar.LENGTH_INDEFINITE); | |
snack.setAction(android.R.string.ok, new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
snack.dismiss(); | |
} | |
}); | |
snack.show(); |
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 class SQLiteHelper extends SQLiteOpenHelper { | |
public DatabaseOperations(Context context) { | |
super(context, DatabaseSchemas.DATABASE_NAME, null, DatabaseSchemas.DATABASE_VERSION); | |
} | |
public void onCreate(SQLiteDatabase db) { | |
//Create all tables | |
db.execSQL(DatabaseSchemas.Table.CREATION_SQL); | |
} |
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
.floating { | |
animation-name: floating; | |
animation-duration: 4s; | |
animation-iteration-count: infinite; | |
animation-timing-function: ease-in-out; | |
margin-left: 30px; | |
margin-top: 5px; | |
} | |
@keyframes floating { |
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
function saveFile(text, filename, mime) { | |
var link = document.createElement('a'); | |
link.setAttribute('download', filename); | |
link.href = window.URL.createObjectURL(new Blob([text], {type: mime})); | |
document.body.appendChild(link); | |
window.requestAnimationFrame(function () { | |
var event = new MouseEvent('click'); | |
link.dispatchEvent(event); | |
document.body.removeChild(link); | |
}); |
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
function loadFile(type) { | |
var fileSelector = $('<input type="file">'); | |
if (type) { | |
fileSelector.attr('accept', type); | |
} | |
fileSelector.change(function () { | |
var file = fileSelector[0].files[0]; | |
fname = file.name; | |
var reader = new FileReader(); | |
reader.onload = function (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
function randomItemFromArray(array){ | |
return array[Math.floor(Math.random()*array.length)]; | |
} |
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
[ $[ $RANDOM % 6 ] == 0 ] && echo Boom || echo *Click* | |
#[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click* |
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
function validVideoId(id) { | |
var img = new Image(); | |
img.src = "http://img.youtube.com/vi/" + id + "/mqdefault.jpg"; | |
img.onload = function () { | |
checkThumbnail(this.width); | |
} | |
} | |
function checkThumbnail(width) { | |
//HACK a mq thumbnail has width of 320. |
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 | |
echo "* * * * * * * *" | |
echo "* .JPG to .PDF File Converting Utility *" | |
echo "* By tonY1883@GitHub *" | |
echo "* * * * * * * *" | |
sleep 1 | |
read -p "Please input the name of the folder:" -e input | |
sleep 1 | |
echo "Reading folder..." | |
sleep 1 |
OlderNewer