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
| # Source: https://superuser.com/questions/640730/mac-os-x-file-associations-keep-changing-though-reverting-it-manually | |
| # Delete LaunchServices prefs: | |
| rm ~/Library/Preferences/com.apple.LaunchServices.plist | |
| # Rebuild the Launch Services database with | |
| /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -domain local -domain system -domain user | |
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
| """ | |
| Feature is 512 1-s or 0-s, label is 1 or 0 | |
| Data represents some bio research on components added to a mixture, | |
| all are independant one from another. | |
| Outcome is passing some threshold for a further research. | |
| """ | |
| import numpy as np | |
| from sklearn.naive_bayes import GaussianNB |
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/bash | |
| # This will dump a list of every directory on the filesystem prefixed with | |
| # the number of files (and subdirectories) in that directory. | |
| # Thus the directory with the largest number of files will be at the bottom. | |
| find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n | |
| # Source: https://unix.stackexchange.com/questions/117093/find-where-inodes-are-being-used |
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
| /** | |
| * Отправка ЛС во ВКонтакте скриптом из консоли браузера. | |
| * Эксперимент для валидации идеи с Electron-приложением. | |
| * Работает 2017-06-09 в Firefox 53.0.3 (64-bit) / Mac OS X 10.11.6 | |
| * | |
| * Выполнять на странице диалога с нужным пользователем | |
| * https://vk.com/im?sel=755074 цифры в конце это id пользователя ВК. | |
| * | |
| * by Sergei Sokolov, hello@sergeisokolov.com, 2017-06-09, Moscow. | |
| */ |
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 | |
| $params = array( | |
| 'code' => " говнокод here ", | |
| 'access_token' => $token, | |
| 'v' => 5.64, | |
| ); | |
| $url = 'https://api.vk.com/method/execute'. '?' . http_build_query( $params); |
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
| /** | |
| * Rail Fence (zigzag) cipher JavaScript implementation. | |
| * https://en.wikipedia.org/wiki/Rail_fence_cipher | |
| */ | |
| (function (root, factory) { | |
| if (typeof define === 'function' && define.amd) { | |
| define([], factory); | |
| } else if (typeof module === 'object' && module.exports) { | |
| module.exports = factory(); | |
| } else { |
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 | |
| /** | |
| * Перевод численных в числа и чисел в текст на Русском языке. | |
| * | |
| * Сергей Соколов hello@sergeisokolov.com Москва 2017. | |
| */ | |
| class NumText { | |
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
| (function(t){var e,n,a,h=$("table"),r={},o=new Date,l="";if(!("my.appscentrum.com"!=window.location.hostname||h.length<4)){for(o.setDate(1),a=0;t>a;a++)e=("0"+(parseInt(o.getMonth())+1)).substr(-2),n=""+o.getFullYear(),r[""+e+"."+n]=0,o.setMonth(o.getMonth()-1);h=h[3],$("tr",h).each(function(t,e){var n,a,h=$("td:nth-child(5)",this).text().split(/[\ \.]/);h.length>=2&&(a=""+h[1]+"."+h[2],r.hasOwnProperty(a)&&(n=$("td:nth-child(3)",this).text(),(n=n.replace(/[^0-9\.]+/g,"")).length&&(r[a]+=parseFloat(n))))});for(key in r)l+=""+Math.round(100*r[key])/100+" руб. за "+key+"\r\n";alert(l)}})(5); |
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
| /** | |
| * Bookmarklet for my.appscentrum.com | |
| * to display agregated payouts by month | |
| * for the last 3 months. | |
| * | |
| * Minify with command: | |
| * | |
| * uglifyjs -m -c negate-iife=false apps-centrum-sum.js | |
| * | |
| * by Sergei Sokolov hello@sergeisokolov.com |
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/bash | |
| # | |
| # Backup database and files of a Wordpress blog running in a Docker container | |
| # | |
| # by Sergei Sokolov hello@sergeisokolov.com | |
| # Moscow, 2016 September 08 | |
| # | |
| DC_MYSQL=dockerwp_mysql_1 |