Skip to content

Instantly share code, notes, and snippets.

View magefad's full-sized avatar

Ruslan Fadeev magefad

  • Russia, Cheboksary, Kazan
View GitHub Profile
@magefad
magefad / disable.sh
Created January 9, 2019 03:13
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
@magefad
magefad / Sony_Xperia_Z5_Compact_disable_bloatware_apps.sh
Created December 9, 2017 21:49
Удаление приложений (Стокового мусора) от Sony и Google
adb shell
pm uninstall --user 0 "com.sonymobile.entrance"
pm uninstall --user 0 "com.sonymobile.lifelog"
pm uninstall --user 0 "com.sonyericsson.trackid"
pm uninstall --user 0 "com.sonymobile.sketch"
pm uninstall --user 0 "com.sonyericsson.xhs"
pm uninstall --user 0 "com.sonymobile.getmore"
pm uninstall --user 0 "com.sonymobile.getmore.client"
pm uninstall --user 0 "com.google.android.music"
@magefad
magefad / console.formdata.js
Created November 18, 2013 07:27
Display form data in console.table chrome
[].forEach.call(document.querySelectorAll('form'), function (input) {
var table = [];
console.group('HTMLForm "' + input.name + '": ' + input.action);
console.log('Element: ', input, '\nName: ' +
input.name + '\nMethod: ' + input.method.toUpperCase() +
'\nAction: ' + input.action || 'null');
['input', 'textarea', 'select'].forEach(function (control) {
[].forEach.call(input.querySelectorAll(control), function (node) {
@magefad
magefad / ActiveRecord.php
Last active December 14, 2015 08:09
Yii мульти-табличный CActiveRecord / multitable CActiveRecord
<?php
class ActiveRecord extends CActiveRecord
{
private static $_tableName;
public static function instance($tableName)
{
self::$_tableName=$tableName;
return parent::model(__CLASS__);
ALTER TABLE `fad_blog` CHANGE `status` `status` TINYINT( 1 ) NOT NULL DEFAULT '1';
ALTER TABLE `fad_blog` CHANGE `type` `type` BOOLEAN NOT NULL DEFAULT TRUE;
ALTER TABLE `fad_blog_post` CHANGE `access_type` `access_type` BOOLEAN NOT NULL DEFAULT TRUE;
ALTER TABLE `fad_blog_post` CHANGE `status` `status` TINYINT( 1 ) NOT NULL DEFAULT '1';
ALTER TABLE `fad_comment` CHANGE `status` `status` TINYINT( 1 ) NOT NULL DEFAULT '1';
ALTER TABLE `fad_gallery` CHANGE `status` `status` BOOLEAN NOT NULL DEFAULT TRUE;
update `fad_gallery` set status=1;
ALTER TABLE `fad_gallery_photo` CHANGE `status` `status` TINYINT( 1 ) NOT NULL DEFAULT '1';
update `fad_gallery_photo` set status=1;
ALTER TABLE `fad_menu` CHANGE `status` `status` BOOLEAN NOT NULL DEFAULT TRUE;
@magefad
magefad / bootstrap-modal-youtube
Created December 15, 2012 10:34
Bootstrap modal youtube iframe stop when close
jQuery(".modal-backdrop, .youtube .btn").click(function() {
var iframe = jQuery(this).parent().parent().find("iframe");
iframe.attr("src", iframe.attr("src"));
});