Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"strings"
)
func main() {
// Use a map to store the unique URL directories we find
dirs := make(map[string]bool)
@kenjoe41
kenjoe41 / base64.py
Last active March 26, 2022 17:01
Python code and mostly pseudo code to encode and decode text. For beginners to know what to go through in implementing a thorough programs to do it.
#!/usr/bin/env python3
# Shebang line. Include it in all the main.py scripts. Readup why, and google more: https://stackoverflow.com/questions/6908143/should-i-put-shebang-in-python-scripts-and-what-form-should-it-take
# Insert your imports here.
def encode_to_base64(inText):
'''
This Function takes in plain text as an input, encodes it to base64, check if everything
went well, then returns encoded text or nil/None/'' otherwise.
@kenjoe41
kenjoe41 / podpen.rb
Last active August 5, 2017 10:00
batch downloads codepen podcasts. Change latest_podcast variable when a new one is out. Quick script for my current needs else a `wget` command will do for a one episode
#!/usr/bin/ruby
require 'fileutils'
require 'rubygems'
require 'typhoeus'
#function to create a directory
def create_a_directory(dir_name)
if dir_name
@kenjoe41
kenjoe41 / bitbucket_repo.py
Created June 9, 2017 11:19
Basic authentication and repo creation with bitbucket
from __future__ import print_function
from pybitbucket.bitbucket import Bitbucket, Client
from pybitbucket.auth import BasicAuthenticator
from pybitbucket.repository import (Repository, RepositoryPayload,
RepositoryForkPolicy)
bitbucket = Client(
BasicAuthenticator(
'username',
@kenjoe41
kenjoe41 / gist:9ed544ea7d6db9713336
Created September 23, 2015 17:51
created by github.com/tr3buchet/gister
import requests
#from bs4 import BeautifulSoup
import mechanicalsoup
from robobrowser import RoboBrowser
from robobrowser.forms.form import Form
def scrape(s, c, n):
"""get all threads from a forum page.
"""
@kenjoe41
kenjoe41 / convert.go
Created August 25, 2015 23:29
created by github.com/tr3buchet/gister
package main
import (
"fmt"
"strconv"
"strings"
"os"
"math"
)
@kenjoe41
kenjoe41 / gister.py
Created May 22, 2015 09:44
created by github.com/tr3buchet/gister
#!/usr/bin/env python
#
# Copyright 2013 Trey Morris
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@kenjoe41
kenjoe41 / gister.py
Created May 22, 2015 09:33
created by github.com/tr3buchet/gister
#!/usr/bin/env python
#
# Copyright 2013 Trey Morris
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@kenjoe41
kenjoe41 / setup.py
Created May 22, 2015 09:24
setup file
#!/usr/bin/env python
#
# Copyright 2013 Trey Morris
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@kenjoe41
kenjoe41 / gist:377500714461cb63beaf
Created May 22, 2015 09:18
created by github.com/tr3buchet/gister
#!/usr/bin/env python
#
# Copyright 2013 Trey Morris
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#