Skip to content

Instantly share code, notes, and snippets.

@ortodesign
ortodesign / google_login.ts
Created August 28, 2021 07:29 — forked from Brandawg93/google_login.ts
Login to Google Account via Puppeteer
import puppeteer from 'puppeteer-extra';
import pluginStealth from 'puppeteer-extra-plugin-stealth'; // Use v2.4.5 instead of latest
import * as readline from 'readline';
puppeteer.use(pluginStealth());
// Use '-h' arg for headful login.
const headless = !process.argv.includes('-h');
// Prompt user for email and password.
@ortodesign
ortodesign / bootstrap-4-sass-mixins-cheat-sheet.scss
Created April 18, 2019 16:41 — forked from anschaef/bootstrap-4-sass-mixins-cheat-sheet.scss
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.1.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/v4-dev/scss/mixins
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;
@ortodesign
ortodesign / IntelIJTrialReset.bat
Last active April 14, 2019 07:19
How to Reset InteIIiJ IDEA Evaluation Key in Windows
:: edited for phpstrom
::cd "C:%HOMEPATH%\.IntelliJIdea*\config"
cd "C:%HOMEPATH%\.PhpStorm2018.3\config"
rmdir "eval" /s /q
del "options\other.xml"
::reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\phpstorm" /f
:: This will work for idea 2018.3 and later
@ortodesign
ortodesign / jQueryToVanilla.js
Created February 25, 2019 09:07
Нативные аналоги jQuery
Нативные аналоги jQuery
Ниже приведены аналоги нативного исполнения jQuery методов, с поддержкой IE 8+
Поиск по селектору
// jQuery
var els = $('.el');
// Native
var els = document.querySelectorAll('.el');
@ortodesign
ortodesign / DBsocialController.php
Created October 16, 2018 07:59
php get protected propety
function getProtectedValue($obj,$name) {
$array = (array)$obj;
$prefix = chr(0).'*'.chr(0);
return $array[$prefix.$name];
}
@ortodesign
ortodesign / readme.md
Created September 25, 2018 09:25 — forked from nonsintetic/readme.md
PHP - Get YouTube subscriber count with Youtube API v3

How to:

Here's a 'simple' way to get the YouTube subscriber number from Google's Youtube API v3:

  1. Go to https://console.developers.google.com/apis/library
  2. Log in with your Google account.
  3. Next to the logo click on 'Project' and 'Create project'. Name it whatever you want and click on 'Create'.
  4. Wait until the project is created, the page will switch to it by itself, it will take a couple of seconds up to a minute. Once it's done it will be selected next to the logo.
  5. Once it's created and selected, click on 'Credentials' from the menu on the left.
  6. Click on 'Create Credentials' and choose 'API Key'. You can restrict it to specific IPs, or types of requests (website, android, ios etc.) if you want, it's safer that way.
@ortodesign
ortodesign / my.cnf
Created March 30, 2018 14:13
mysql 5.7.21 utf-8 support
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
character-set-server = utf8
collation-server = utf8_unicode_ci
[client]
default-character-set = utf8
@ortodesign
ortodesign / ys_functions.js
Created March 29, 2018 09:15
Эмуляция события etype на элементе el (pure js)
/**
* Эмуляция события etype на элементе el
* @param el
* @param etype
*/
function eventFire(el, etype){
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
@ortodesign
ortodesign / modx-snippets.php
Created March 9, 2018 08:44 — forked from christianhanvey/modx-snippets.php
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@ortodesign
ortodesign / parse_newEgg.php
Created March 5, 2018 11:00
Parse JS object (not JSON) in PHP
class JsParserException extends Exception {}
function parse_jsobj($str, &$data) {
$str = trim($str);
if(strlen($str) < 1) return;
if($str{0} != '{') {
throw new JsParserException('The given string is not a JS object');
}
$str = substr($str, 1);
// print_r($str);