Skip to content

Instantly share code, notes, and snippets.

View Swader's full-sized avatar
🏠
Buidling

Bruno Škvorc Swader

🏠
Buidling
View GitHub Profile
@Swader
Swader / bgjs.js
Created December 7, 2013 01:43
Background final part 3
"use strict";
var Base64 = {_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", encode: function (r) {
var t, e, a, o, h, n, C, c = "", i = 0;
for (r = Base64._utf8_encode(r); i < r.length;)t = r.charCodeAt(i++), e = r.charCodeAt(i++), a = r.charCodeAt(i++), o = t >> 2, h = (3 & t) << 4 | e >> 4, n = (15 & e) << 2 | a >> 6, C = 63 & a, isNaN(e) ? n = C = 64 : isNaN(a) && (C = 64), c = c + this._keyStr.charAt(o) + this._keyStr.charAt(h) + this._keyStr.charAt(n) + this._keyStr.charAt(C);
return c
}, _utf8_encode: function (r) {
r = r.replace(/\r\n/g, "\n");
for (var t = "", e = 0; e < r.length; e++) {
var a = r.charCodeAt(e);
@Swader
Swader / create_failed_jobs_table.php
Created August 27, 2023 11:05
Laravel Breeze Migrations
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
@Swader
Swader / edition_sections.php
Last active September 2, 2023 04:53
Cursor Migration Output
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateEditionSectionsTable extends Migration
{
public function up()
{
@Swader
Swader / editions_and_editionsections.php
Created August 27, 2023 19:42
Code Llama Migration Output
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSectionsAndEditionSectionsTables extends Migration
{
/**
* Run the migrations.
@Swader
Swader / editions.php
Created August 27, 2023 11:33
ChatGPT Migration Output
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateEditionsTable extends Migration
{
public function up()
{
Schema::create('editions', function (Blueprint $table) {
$table->id();
@Swader
Swader / MyCryptoProfile.md
Created June 21, 2022 16:24
MyCryptoProfile.md

Linking my account swader on GitHub with my address 5CK8D1sKNwF473wbuBP6NuhQfPaWUetNsWUNAAzVwTfxqjfr on Substrate in mycryptoprofile.io, and the challenge code is: 0460bfdffa715f8b188a01128ad40b39. #LitentryVerifyMyAddress

@Swader
Swader / .gitignore
Last active March 4, 2022 21:18
ultimate-gitignore
# Composer
vendor
composer.phar
# IntelliJ - PhpStorm and PyCharm
.idea
*.ipr
*.iws
# Eclipse
@Swader
Swader / demo.php
Created February 17, 2014 13:47
Mehul Jain's captcha sample
<?php
session_start();
$_SESSION['count'] = time();
$image;
?>
<title>demo.php</title>
<body style="background-color:#ddd; ">
<?php
5CvcK8o745NwUeLCmEoP4WpDPpB6eKduxR7fV3GtTJCvWysj
5Gdj9n5idJwTjJY5f2QWmrfu5yS57SGGEJt5rsw9UoLuRbYo
5CqULFyV8rgpy3bd3yJGfyFoPrn2EP46vnn86ey4FP5j4nih
5ED1tYzMYqN5pUFeQLNHUKqw9h7t6vrMzdPhiGxjPL4HMHqn
5EgtXK8zsxUu47Zg1ASZF7KzNtWowk6Grp9qEFeVC6C5vgDU
5CZnrJuy9iEYpcSUucTGzzmWvPj9hEicgBxXF3RFTooRXBRa
5HpRcaD8q95mejgSUsyaqbQeczYZcpbLzSvDZYBHj7ZFvtfJ
5Gs3Vmbsr2xaBLCKwTqvUfT511u14QB9jqks2WEsQyWvNvLC
5GbrTYbpLNanZ9c3TjkAURAT91VchpTtE82Vy2mgiex8gqTt
5C89Z5bkp3nAjEcnFFsYxW7b5rj3X3PK38p46zNPYSyWXtQT
@Swader
Swader / tutexample.md
Created May 14, 2018 15:30
tutexample

Sometimes you need to log into a site to get to some walled-off data. Let's see an example.

Let's assume we want to crawl the articles on TheBrowser.com. TheBrowser is a manually curated subscription based website which recommends popular links around the web.

TheBrowser.com

Getting the Login Cookie

Once you have an account on the site you're wanting to crawl (TheBrowser's will cost you some $35 yearly but same procedure applies to any website with a paywall / log in area), log into it.