Skip to content

Instantly share code, notes, and snippets.

@scrapingace
scrapingace / books_scraper.php
Last active November 15, 2022 20:14
Simple PHP Scraper Example
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
class BooksScraper {
function __construct() {
//setup base_uri
$this->base_uri = 'https://books.toscrape.com/';
// create Guzzle HTTP client
@phistep
phistep / init.vim
Last active March 22, 2023 20:33
firenvim config
" """
" firenvim (browser textareas)
"
" unfortunately `if exists('g:started_by_firenvim')` doesn't work with
" laststatus and tabline. So we need to use the OnUIEnter function to set
" specific options
function! s:IsFirenvimActive(event) abort
if !exists('*nvim_get_chan_info')
return 0
@MoonTahoe
MoonTahoe / upload.yaml
Last active April 16, 2024 21:40
Github Action to build iOS app with expo and upload to testflight
# Just place this file in your repo under the .github/workflows folder.
# You set all of the secrets in the setting of the repo
name: Deploy to Testflight
# When a pull request is closed...
# This is because this action commits back to the repository
# so setting this on a push would cause an infinite loop of commits
# unless you pragmatically check the contents of the repo or something
@ospatil
ospatil / Vagrantfile for Fedora 31 and Python 3.8
Last active June 6, 2023 06:46
Vagrant configuration for Fedora 31 and Python 3.8
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@ben-kirby
ben-kirby / App.js
Created August 13, 2019 21:14
Using Semantic UI in tandem with Styled Components
import React, { Component } from 'react';
import { Button } from 'semantic-ui-react';
import { StyledButton } from './styledComponents';
export default class App extends Component {
render(){
return(
<div>
<Button>This is a normal Semantic button</Button>
<StyledButton>This is a Semantic button that has been styled with Styled Components</StyledButton>
@2KAbhishek
2KAbhishek / Shell_Keybindings.md
Last active April 17, 2024 14:47
Keyboard shortcuts for bash/zsh

Shell Keybindings

Navigation 🚀

Alt + f/b - Move cursor to previous/next word

Ctrl + a/e - Move cursor to beginning/end of command

Ctrl + xx - Toggle between the start of line and current cursor position

@SidharthArya
SidharthArya / alttab
Last active November 17, 2023 22:50
Sway Windows Manager Alt Tab behavior
#!/usr/bin/env python3
import sys
import json
import subprocess
direction=bool(sys.argv[1] == 't' or sys.argv[1] == 'T')
swaymsg = subprocess.run(['swaymsg', '-t', 'get_tree'], stdout=subprocess.PIPE)
data = json.loads(swaymsg.stdout)
current = data["nodes"][1]["current_workspace"]
@cho2
cho2 / virtualbox-silverblue.md
Last active June 10, 2023 00:13
Virtualbox on Team Silverblue
  • Install virtualbox repo

    cd /etc/yum.repos.d/
    wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
    
  • Edit virtualbox repo

    nano /etc/yum.repos.d/virtualbox.repo
    
@DusanMadar
DusanMadar / TorPrivoxyPython.md
Last active April 17, 2024 04:56
A step-by-step guide how to use Python with Tor and Privoxy

A step-by-step guide how to use Python with Tor and Privoxy

Latest revision: 2021-12-05.

Tested on Ubuntu 18.04 Docker container. The Dockerfile is a single line FROM ubuntu:18.04. Alternatively, you can simply run docker run -it ubuntu:18.04 bash.

NOTE: stopping services didn't work for me for some reason. That's why there is kill $(pidof <service name>) after each failed service <service name> stop to kill it.

References

@gnuton
gnuton / Mixamo.js
Last active January 22, 2024 07:29
Script which downloads all mixamo animations for one character.
// Mixamo Animation downloadeer
//
// Author: Antonio Aloisio <gnuton@gnuton.org>
// Contributions: kriNon
//
// The following script make use of mixamo2 API to download all anims for a single character that you choose.
// The animations are saved with descriptive long names instead of the short ones used by default by mixamo UI.
//
// This script has been written by gnuton@gnuton.org and the author is not responsible of its usage
//