Skip to content

Instantly share code, notes, and snippets.

View tblobaum's full-sized avatar
😆

Thomas J Blobaum tblobaum

😆
  • Creston, Iowa
View GitHub Profile
@ashutoshkrris
ashutoshkrris / main.py
Last active August 21, 2023 23:37
Know your horoscope using Python
import requests
from bs4 import BeautifulSoup
def get_horoscope(zodiac_sign: int, day: str):
if not "-" in day:
res = requests.get(
f"https://www.horoscope.com/us/horoscopes/general/horoscope-general-daily-{day}.aspx?sign={zodiac_sign}")
else:
day = day.replace("-", "")
@sondt2709
sondt2709 / octokit-push-commit.js
Created May 11, 2021 18:37
Octokit push commit
// Source: https://dev.to/lucis/how-to-push-files-programatically-to-a-repository-using-octokit-with-typescript-1nj0
const { Octokit } = require('@octokit/rest')
const glob = require('globby')
const path = require('path')
const { readFile } = require('fs-extra')
// org or owner
const ORGANIZATION = process.env.ORGANIZATION
@jdberrocal1
jdberrocal1 / get_horoscope_sign_by_dob.js
Last active September 30, 2021 00:48
Get Horoscope Sign By DOB (Javascript)
const SIGN_NAMES = [
{
sign: 'Aquarius',
start: {
day: 20,
month: 1,
},
end: {
day: 18,
month: 2,
@yakovsh
yakovsh / 2005_06_03-remove_vowels_from_hebrew.js
Last active May 23, 2022 19:43
Removing Vowels from Hebrew Unicode Text
/*
* One of the questions that recently came up is how to remove vowels from Hebrew characters in Unicode
* (or any other similar language). A quick look at Hebrew Unicode chart shows that the vowels are all
* located between 0x0591 (1425) and 0x05C7 (1479). With this and Javascript's charCodeAt function, it
* is trivial to strip them out with Javascript as follows
*
* Live demo is available here:
* https://jsfiddle.net/js0ge7gn/
*/
@fhoffa
fhoffa / top_reddit_words.md
Last active September 1, 2021 20:08
The top 5 words for the top subreddits

The top 5 words for the top subreddits:

subr words
pics hell,minutes,hospital,build,backyard
funny soon,wanted,dads,photos,sums
videos better,change,plane,simple,curiosity
politics subject,democrat,democracy,basis,google
technology streaming,snowden,fast,edward,sued
@annalinneajohansson
annalinneajohansson / ajax.js
Last active December 31, 2023 05:50
Basic AJAX function in WordPress
jQuery(document).ready(function($){
var ajaxurl = object.ajaxurl;
var data = {
action: 'my_action', // wp_ajax_my_action / wp_ajax_nopriv_my_action in ajax.php. Can be named anything.
foobar: 'some value', // translates into $_POST['foobar'] in PHP
};
$.post(ajaxurl, data, function(response) {
alert("Server returned this:" + response);
});
});
@bzerangue
bzerangue / html2md-with-pandoc.sh
Created April 26, 2012 23:14
RECURSIVELY Bash convert all your html to markdown files (with Pandoc)
find . -name "*.ht*" | while read i; do pandoc -f html -t markdown "$i" -o "${i%.*}.md"; done
var mongoose = require('./../../mongoose');
mongoose.connect('localhost', 'testing_tojsonWithVirtuals');
var schema = new mongoose.Schema({
name: {
first: String
, last: String
}
, age: Number
@tj
tj / app.js
Created December 17, 2011 23:15
express 3.x cookie session middleware example
var express = require('express')
, cookieSessions = require('./cookie-sessions');
var app = express();
app.use(express.cookieParser('manny is cool'));
app.use(cookieSessions('sid'));
app.get('/', function(req, res){
req.session.count = req.session.count || 0;
@indexzero
indexzero / opensource-guidelines.md
Created November 9, 2011 01:54
The least amount of guidelines possible to maintain 150+ open source node.js modules

Guidelines for Open Source at Nodejitsu

README.md Outline

  • Header
    • Brief description (should match package.json)
  • Example (if applicable)
  • Motivation (if applicable)
  • API Documentation: This will likely vary considerably from library to library.
  • Installation