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 android.annotation.TargetApi; | |
import android.content.ContentUris; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.os.Environment; | |
import android.provider.DocumentsContract; | |
import android.provider.MediaStore; | |
import android.provider.OpenableColumns; |
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 android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import com.vspallas.npflocker.R; | |
import com.vspallas.npflocker.general.FileType; | |
import com.vspallas.npflocker.listeners.RecyclerItemClickListener; | |
import com.vspallas.npflocker.models.FileItem; |
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 android.support.v4.graphics.ColorUtils; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
/** | |
* Created by Vassilis Pallas on 8/26/16. | |
*/ | |
class ColorHelper { |
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
<?php | |
namespace App; | |
/** | |
* Created by PhpStorm. | |
* User: Vassilis Pallas | |
* Date: 7/6/16 | |
* Time: 1:44 AM |
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
jQuery('#copy').on('click', function () { | |
copyToClipboard(); | |
}); | |
function copyToClipboard() { | |
var target = jQuery('#hidden_text'); | |
// make it visible, so can be focused | |
target.attr('type', 'text'); | |
target.focus(); |
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 function getDownload() | |
{ | |
$file = public_path() . "/download/info.pdf"; | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// .pdf -> application/pdf | |
// | |
// .doc -> application/msword | |
// | |
// .docx -> application/vnd.openxmlformats-officedocument.wordprocessingml.document |
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
cp /etc/netctl/examples/ethernet-dhcp /etc/netctl/ethernet-dhcp | |
ip a | |
nano /etc/netctl/ethernet-dhcp | |
# replace interface value with the one you want (wlp3s0) | |
ip link set interface up | |
dhcpcd | |
ping -c 2 google.com |
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
# show the list of hard drivers | |
fdisk -l | |
# setup partitions (change /dev/sda to whatever your hard drive is) | |
fdisk /dev/sda | |
# blank out the hard drive | |
o | |
# create first partition (/) | |
n |
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
const assert = require('assert'); | |
const numberFormat = require('./numberFormat'); | |
assert.strictEqual( | |
numberFormat(132323232320.321, 2, ',', '.'), | |
'132.323.232.320,32' | |
); | |
assert.strictEqual( | |
numberFormat(10.22), | |
'10.22' |