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.gabesechan.android.reusable.receivers; | |
import java.util.Date; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.telephony.TelephonyManager; | |
public abstract class PhonecallReceiver extends BroadcastReceiver { |
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
# Raspberry software used | |
2015-02-16-raspbian-wheezy.img | |
# Install dependencies | |
sudo apt-get update | |
sudo apt-get install -y python-pip python-virtualenv python-dev | |
# Enable audio 3.5mm: 1=>3.5mm 2=>HDMI | |
amixer cset numid=3 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
#!/bin/sh | |
# Author: Nicolas Schneider | |
# Mounts all volumes that are mounted in a Docker container | |
# under a given root relative to their mount point in the container. | |
# Usage: bindMountDockerData.sh container /mnt/path | |
# | |
# Example: Docker container 'demo' which has a volume mounted at /somedata and | |
# another at /home/userdata. | |
# Running 'bindMountDockerData.sh demo /mnt/dockerdemo' | |
# will result in: |
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, find the container's name or ID: | |
$ docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
b9b7400ddd8f ubuntu:latest "/bin/bash" 2 seconds ago Up 2 seconds elated_hodgkin | |
In the example above we can either use b9b7400ddd8f or elated_hodgkin. | |
If you wanted to copy everything in /tmp/somefiles on the host to /var/www in the container: | |
$ cd /tmp/somefiles |
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
(Linux Example) Create partitions: | |
# parted -s /dev/vdb mklabel gpt | |
# parted -s /dev/vdb unit mib mkpart primary 0% 100% | |
(Linux Example) Create filesystem: | |
# mkfs.ext4 /dev/vdb1 | |
(Linux Example) Mount block storage: | |
# mkdir /mnt/blockstorage | |
# echo >> /etc/fstab |
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
/* To get a list of decades with the years, from a range selection. Useful for navigational elements on webpages, for example. */ | |
Array | |
( | |
[2010] => Array | |
( | |
[0] => 2018 | |
[1] => 2017 | |
[2] => 2016 | |
[3] => 2015 |
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
sudo apt-get purge $(for tag in "linux-image" "linux-headers"; do dpkg-query -W -f'${Package}\n' "$tag-[0-9]*.[0-9]*.[0-9]*" | sort -V | awk 'index($0,c){exit} //' c=$(uname -r | cut -d- -f1,2); done) |
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
<?php | |
$group = "pcldtmdv"; | |
//$years = range(2002, 2012); | |
$years = range(2013, 2018); | |
try { | |
$db = new PDO('mysql:dbname=arb01_data;host=localhost', 'arb01_automation', '6@yyM^cl42!0s44ai5'); | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
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
SELECT | |
page_size, | |
COUNT(1) AS `count` | |
FROM | |
pdf_inventory | |
GROUP BY | |
page_size | |
ORDER by count DESC |
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
http://reeddesign.co.uk/test/points-pixels.html | |
Points Pixels Ems Percent | |
6pt 8px 0.5em 50% | |
7pt 9px 0.55em 55% | |
7.5pt 10px 0.625em 62.5% | |
8pt 11px 0.7em 70% | |
9pt 12px 0.75em 75% | |
10pt 13px 0.8em 80% | |
10.5pt 14px 0.875em 87.5% |