Skip to content

Instantly share code, notes, and snippets.

View alexcatdad's full-sized avatar
🤯
Too many ideas

Alex Alexandrescu alexcatdad

🤯
Too many ideas
  • Bucuresti
  • 07:50 (UTC -12:00)
View GitHub Profile
@alexcatdad
alexcatdad / env-vars.js
Created January 17, 2019 13:41
SImple nodejs script that uses .env to generate environment.ts for Angular projects made to work on a lot of environments
#! /usr/bin/env node
const dotenvParseVariables = require('dotenv-parse-variables');
const fs = require('fs');
const chalk = require('chalk');
const envVars = require('dotenv-safe').config({
allowEmptyValues: true
});
const parsedVars = dotenvParseVariables(envVars.parsed);
@alexcatdad
alexcatdad / class.js
Created February 22, 2017 17:01
InstaLikesClass
class InstaAllLikes {
constructor() {
this.heartClass = '.coreSpriteHeartOpen';
this.nextButton = '._de018.coreSpriteRightPaginationArrow';
this.minInterval = 5;
this.maxInterval = 20;
this.likeCount = 0;
this.timeout;
const popUp = document.querySelector('._n3cp9._d20no');
@alexcatdad
alexcatdad / is_bot.php
Created November 18, 2013 12:28
Function that checks if visitor is a bot to allow indexing by search engines and social media when you have an age gate or something similar
function is_bot() {
$spiders = array( "alexa", "froogle", "abot", "dbot", "ebot", "hbot", "kbot", "lbot", "mbot", "nbot", "obot", "pbot", "rbot", "sbot", "tbot", "vbot", "ybot", "zbot", "bot.", "bot/", "_bot", ".bot", "/bot", "-bot", ":bot", "(bot", "crawl", "slurp", "spider", "seek", "accoona", "acoon", "adressendeutschland", "ah-ha.com", "ahoy", "altavista", "ananzi", "anthill", "appie", "arachnophilia", "arale", "araneo", "aranha", "architext", "aretha", "arks", "asterias", "atlocal", "atn", "atomz", "augurfind", "backrub", "bannana_bot", "baypup", "bdfetch", "big brother", "biglotron", "bjaaland", "blackwidow", "blaiz", "blog", "blo.", "bloodhound", "boitho", "booch", "bradley", "butterfly", "calif", "cassandra", "ccubee", "cfetch", "charlotte", "churl", "cienciaficcion", "cmc", "collective", "comagent", "combine", "computingsite", "csci", "curl", "cusco", "daumoa", "deepindex", "delorie", "depspid", "deweb", "die blinde kuh", "digger", "ditto", "dmoz", "docomo", "download express", "dtaagent", "dwcp",
@alexcatdad
alexcatdad / gist:5480580
Last active February 12, 2016 15:11
For responsive pages, when you embed a Youtube video it resizes with the containersource: http://css-tricks.com/examples/FluidWidthYouTube/
//jQuery is required
$(function() {
// Find all YouTube videos
var $allVideos = $("iframe[src^='http://www.youtube.com']"),
// The element that is fluid width
$fluidEl = $("body");
// Figure out and save aspect ratio for each video
$allVideos.each(function() {
$(this)