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
@Nama
Nama / sway_workspaces.py
Last active January 27, 2023 18:54
Restore workspaces in sway to displays and move applications to saved workspaces. Maintained in its own repo now: https://github.com/Nama/sway-workspaces
#!/usr/bin/python
'''
* setup displays first, e.g. with wdisplay
* run after setting up your displays `python sway_workspaces.py save <profilename>`
* repeat for every display setup
* setup kanshi and make it run `python sway_workspaces.py load <profilename>`
Multiple windows of an application/class aren't handled. No idea how to do so.
Had to alter the default tree, so the outputs are not the ports.
@bruteforks
bruteforks / atomic_habits.md
Created January 27, 2023 18:18 — forked from saikocat/atomic_habits.md
[Advice] Summary of Atomic Habits
@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>
@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
@jeffchao
jeffchao / show-git-branch
Last active May 27, 2023 09:26
Show git branches ordered by latest commit. Also by name and date.
# By commit hash
git for-each-ref --sort=-committerdate refs/heads/
# By name, date.
git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(authorname) %(refname:short)'
name: Pull Request into Master, Develop and Preprod
on:
pull_request:
branches:
- "master"
- "develop"
- "preprod"
jobs:
@saikocat
saikocat / atomic_habits.md
Last active May 31, 2023 21:19
[Advice] Summary of Atomic Habits
@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
@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