Skip to content

Instantly share code, notes, and snippets.

@aceat64
aceat64 / pubkey.txt
Last active February 18, 2017 20:53
New Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mFIEWHKfFRMIKoZIzj0DAQcCAwRBOUwl7zl7+g8cjsg7ahR0nUlAXilUu+IPhDm2
YlbjB52iZ4SMEs4XTmsHXLa+5T8CQ+td7d/GzspIu6JKCz9stCZBbmRyZXcgTGVD
b2R5IDxhbmRyZXdsZWNvZHlAZ21haWwuY29tPoh5BBMTCAAVBQJYcp8VAgsJAhsD
AhUIAhYAAheAABYJEL8A5v40aOcWCxpUUkVaT1ItR1BHIocA/1xQPtNOFroHaTGG
wO7nX/SLssTu28L1wLaWfXR8oX3wAP9VEeCacrCRHYqlW82f6LbglYTNjUkNTvX+
haLbzW+pWohGBBARAgAGBQJYqLJdAAoJEPBB1Mudnn+S+HcAoOCP4j7dXlsiHIZF
ByDdjD3tT9VQAKD1hy1iLszpNIWFcfLd0UHh68B4dLhWBFhynxUSCCqGSM49AwEH
@aceat64
aceat64 / delete_dups_from_gmusic.py
Created January 17, 2017 03:55
Delete duplicate files from google music
#!/usr/bin/python
from gmusicapi import Mobileclient
import sys, json
api = Mobileclient()
logged_in = api.login('username@gmail.com', 'password_or_app_password_if_using_2fa', Mobileclient.FROM_MAC_ADDRESS)
if logged_in:
count = 0
dupes = 0
songs = api.get_all_songs()
default_view:
view: yes
entities:
# - group.location
- group.thermostat
- group.garage
# - group.bedroom
# - group.cameras
environment:
Verifying that +andrewl is my blockchain ID. https://onename.com/andrewl
<?php
$routes->resources('NetworkObjects', ['inflect' => 'dasherize'], function ($routes) {
$routes->resources('Attributes');
});
AssetsController.php:
<?php
public $paginate = array(
// The default number of rows to show on a page
'limit' => 100,
// The max number of rows that can be shown on a page
'maxLimit' => 1000,
// Use custom find so we can sort by 2nd level associated models
@aceat64
aceat64 / gist:9f9bd704340f1390cdc2
Created December 18, 2014 22:46
Null vs Empty Arrays
$ php -a
Interactive mode enabled
php > var_dump(array(null));
array(1) {
[0]=>
NULL
}
php > var_dump(array());
array(0) {
@aceat64
aceat64 / gist:82df3918b39a56c24470
Last active August 29, 2015 14:11
Random new lines on output
<?php
$parser->addSubcommand('sharepoint', array(
'help' => __('Import from sharepoint csv'),
'parser' => array(
'description' => array(
"Use this command to import assets from a CSV file created by sharepoint.",
"The file argument is required for this command.",
"The following fields are required: serial number, asset tag, model, vendor | manufacturer, bundle id | service id",
),
'arguments' => array(
@aceat64
aceat64 / gist:4677089
Last active December 11, 2015 23:29
snippet from phpBB's auth_ldap.php file
<?php
// generate user account data
$ldap_user_row = array(
'username' => $username,
'user_password' => phpbb_hash($password),
'user_email' => (!empty($config['ldap_email'])) ? utf8_htmlspecialchars($ldap_result[0][htmlspecialchars_decode($config['ldap_email'])][0]) : '',
'group_id' => (int) $row['group_id'],
'user_type' => USER_NORMAL,
'user_ip' => $user->ip,
'user_new' => ($config['new_member_post_limit']) ? 1 : 0,
*Add pagination of items to categories/view
*Add pagination of items to rooms/view
*Room printouts with QR codes
*Tooltips or help page to explain fields
*Advanced search
**Search through attributes, files, comments and verifications
*Grid view for categories
*CSV export system
*Thumbnails for uploaded files
*AJAXify things like adding comments, files, verifications, etc