Skip to content

Instantly share code, notes, and snippets.

View cloudynetwork's full-sized avatar

Peter Joseph cloudynetwork

View GitHub Profile
@shinitiandrei
shinitiandrei / Vagrantfile
Last active July 28, 2022 03:35
Default Vagrant for a Developer's box
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "boxcutter/ubuntu1804-desktop"
config.vm.box_version = "17.0907.1"
config.disksize.size = '15GB'
config.vm.provider "virtualbox" do |vb|
vb.name = "base_box_development"
@igorlg
igorlg / parse_budget.py
Created May 11, 2016 02:53
YNAB Export Parser - Parse CSV Files exported from YNAB and add extra fields
import csv, sys
from datetime import date,datetime
def parse_budget(csvarr):
if '$' not in csvarr[4]:
return False
dt = datetime.strptime(csvarr[0], '%b %Y')
month = dt.month
year = dt.year
// Bonfire: Truncate a string
// Author: @cloudynetwork
// Challenge: http://www.freecodecamp.com/challenges/bonfire-truncate-a-string?solution=function%20truncate(str%2C%20num)%20%7B%0A%20%20%2F%2F%20Clear%20out%20that%20junk%20in%20your%20trunk%0A%20%20%0A%20%20var%20newString%20%3D%20%22%22%3B%0A%20%20%0A%20%20if%20(%20str.length%20%3E%20num%20%26%26%20num%20%3E%203%20%26%26%20num%20%26%26%20str.length%20%3E%20num)%20%7B%0A%20%20%20%0A%20%20%20%20newString%20%3D%20str.slice(0%2Cnum-3).concat(%22...%22)%3B%0A%20%20%7D%0A%20%20%0A%20%20else%20if%20(str.length%20%3E%20num%20%26%26%20num%20%26%26%20str.length%20%3E%20num)%20%7B%0A%20%20%20%20newString%20%3D%20str.slice(0%2Cnum).concat(%22...%22)%3B%0A%20%20%0A%20%20%7D%0A%20%20%0A%20%20else%20%7B%0A%20%20%20%20return%20str%3B%0A%20%20%7D%0A%20%20%0A%20%20return%20newString%3B%0A%7D%0A%0Atruncate(%22A-tisket%20a-tasket%20A%20green%20and%20yellow%20basket%22%2C%2011)%3B%0A
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function truncate(str, num) {
// Bonfire: Confirm the Ending
// Author: @cloudynetwork
// Challenge: http://www.freecodecamp.com/challenges/bonfire-confirm-the-ending?solution=function%20end(str%2C%20target)%20%7B%0A%20%20%2F%2F%20%22Never%20give%20up%20and%20good%20luck%20will%20find%20you.%22%0A%20%20%2F%2F%20--%20Falcor%0A%20%20%0A%20%20return%20str.substr((-1%20*%20target.length))%20%3D%3D%3D%20target.substr((-1%20*%20target.length))%3B%0A%7D%0A%0Aend(%22Bastian%22%2C%20%22n%22)%3B%0A
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function end(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
return str.substr((-1 * target.length)) === target.substr((-1 * target.length));