Skip to content

Instantly share code, notes, and snippets.

View ivanaugustobd's full-sized avatar
🦥
Automating stuff

Ivan Augusto ivanaugustobd

🦥
Automating stuff
  • World Wide Weeb
View GitHub Profile
@DorkForce
DorkForce / scanScope.txt
Last active March 6, 2024 18:33
Console script - Search breakpoint model for value. SYNTAX: scanScope($scope.model, 'Fred');
console.log("Usage Syntax: scanScope(objectToScan, 'scanFor', ['whatToIgnore']); %c(whatToIgnore is optional and can be a string, or an array of strings) (scanScope can be shortened to ss)", 'color: red');
var abortAtLevel = 20,
callStack = 0,
errArray = [],
funArray = [],
scanLoop = function (whatToScan, scanValue, whatToIgnore, parentTree) {
scanValue = scanValue.toLowerCase();
if (Array.isArray(whatToIgnore)) {
whatToIgnore.forEach(function (ignoreVal) {
ignoreVal = lowerCase(ignoreVal);
@danielgtaylor
danielgtaylor / gist:0b60c2ed1f069f118562
Last active April 2, 2024 20:18
Moving to ES6 from CoffeeScript

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

@ilkereroglu
ilkereroglu / simply-sending-e-mails-with-mailx.md
Created September 22, 2015 21:53
How To Send E-Mail On CentOS 7

Installing mailx

yum -y update
yum install -y mailx

We can now start sending e-mails using

@plainspooky
plainspooky / vbshortcuts
Last active November 6, 2015 10:48
VirtualBox shortcuts to an easy VM management, feel free to fix and imporove.
#!/bin/bash
#
# vbshortcuts
# VirtualBox shortcuts to an easy VM management, feel free to dix and imporove.
#
# use: "$ source vbshortcuts" or "$ . vbshortcuts"
#
# (c)2015 - Giovanni Nunes <giovanni.nunes@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
generatePagesArray: function(currentPage, collectionLength, rowsPerPage, paginationRange)
{
var pages = [];
var totalPages = Math.ceil(collectionLength / rowsPerPage);
var halfWay = Math.ceil(paginationRange / 2);
var position;
if (currentPage <= halfWay) {
position = 'start';
} else if (totalPages - halfWay < currentPage) {
@ProcessEight
ProcessEight / Testing in Magento 2.md
Last active February 7, 2024 14:42
M2: Notes on setting up PHPUnit and writing/troubleshooting tests in Magento 2
@goncalossilva
goncalossilva / .gitconfig
Last active April 8, 2021 15:25
Autoremove deleted and merged branches, locally and remotely.
[alias]
autoremove = "!f() { \
whitelist=\"master|dev|legacy\"; \
git fetch --prune; \
if [ -z \"$1\" ]; then \
list=$(git branch --merged | egrep -v \"(^\\*|$whitelist)\") && \
cmd='echo \"$list\" | xargs -n 1 git branch -d'; \
else \
list=$(git branch -r --merged | grep \"$1\" | egrep -v \"(>|$whitelist)\") && \
cmd='echo \"$list\" | cut -d'/' -f2- | xargs -n 1 git push \"$1\" --delete'; \
@vjeux
vjeux / x.md
Last active January 6, 2024 07:15
Ocaml / functional programming

I'm taking down this post. I just posted this as a side comment to explain a sentence on my latest blog post. This wasn't meant to be #1 on HN to start a huge war on functional programming... The thoughts are not well formed enough to have a huge audience. Sorry for all the people reading this. And please, don't dig through the history...

@micycle1
micycle1 / a.md
Last active April 6, 2024 14:26
Downloading full-size media from DeviantArt

For direct image URL, the image quality is much lower than the original upload (the resolution and size of the original upload can be found in the right sidebar). This is not the case few years ago when the original image was accessible through right click, but on 2017, Wix acquired DeviantArt, and has been migrating the images to their own image hosting system from the original DeviantArt system. They linked most of the direct images to a stripped-down version of the original images; hence the bad image quality. Below are the three different formats of direct image URLs I found:

  • URL with /v1/fill inside: this means that the image went through Wix's encoding system and is modified to a specific size and quality. In this case, you remove ?token= and its values, add /intermediary in front of /f/ in the URL, and change the image settings right after /v1/fill/ to w_5100,h_5100,bl,q_100. The definitions of the values can be found in [Wix's Image Service](https://support.wi
@daniloaldm
daniloaldm / step-1-php-apache.sh
Last active October 7, 2020 18:28 — forked from kelvysmoura/step-1-php-apache.sh
Configuração de ambiente para a instalação do magento 2
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php5.6 -y
sudo apt install php7.0 -y
sudo apt install php7.1 -y
sudo apt install php7.2 -y