Skip to content

Instantly share code, notes, and snippets.

View lewdlime's full-sized avatar
🏠
Working from home

Sammy S. lewdlime

🏠
Working from home
View GitHub Profile
@lewdlime
lewdlime / .gitignore
Created November 5, 2012 18:02
abc-scores
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@lewdlime
lewdlime / .gitignore
Created November 12, 2012 17:32
abcvim-gist
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@lewdlime
lewdlime / bash_profile
Last active October 8, 2016 09:44
.bash_profile & .bashrc
# bash shell login profile
# Source bashrc by default
if [ -n "$BASH_VERSION" ]; then
if [ -f "$HOME/.bashrc" ]; then
source "$HOME/.bashrc"
fi
fi
# vim:ff=unix ts=4 ss=4 fdm=marker
#!/bin/bash
# list directories recursively, with pretty-printing. Prints one item per line.
ls -R $1 | awk '
/:$/&&f{s=$0;f=0}
/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}
NF&&f{ print s"/"$0 }'
@lewdlime
lewdlime / multibooru_downloader.perl
Last active January 29, 2019 23:05
MultiBooru Downloader
#!/usr/bin/perl
# Made by Anonymous; modified by Dariush to work with Danbooru 2
# v.2.1.0 - added blacklist, fixed downloading of tags with over 200 images, generally cleaned up;
# v.2.2.0 - added Gelbooru support, made everything extensible for support for more sites later;
# v.2.3.0 - added Pixiv support, added blacklist addition from the command line, revamped the code, added automatic subdirectory creation, remade the way Sigint works, unified tag and pool downloads (note that pools aren't explicitly supported right now, but you can still grab them by searching for "pool:XXXX" as tag);
# v.2.4.0 - changed argument handling so that quotes are no longer required, added folder and file naming schemes; blacklist now supports multi-tag combinations;
# v.2.4.1 - added Pixiv tag downloads. Unfortunately, if they contain Japanese characters, they have to be entered in the parameter section of the script itself, since commandline doesn't pass Unicode to Perl properly;
# v.2.4.2 - added DeviantArt support. No oth

Convert a MBR disk to GPT without losing any operating system data (Windows 7)

By Greg5884

Introduction

For the past week, I've been determined to triple boot with my existing Windows 7 installation, Ubuntu, and Mac OS X (Hackintosh). In order to do so on my laptop, I would have to change the partition table from MBR (Master Boot Record) to GPT (Guided Partition Table).

However, I did not want to lose my existing Windows 7 installation since I had a lot of files/applications already installed. Moreover, I've had a woeful track record of having my data botched during Windows backups.

Many of the how-to's covering this conversion typically say that you have to wipe the entire hard drive and reinstall, but after following a few different guides and doing enough tinkering around in Windows PE, I managed to retain my same Windows partition without any loss.

@lewdlime
lewdlime / MacOSXEnvironmentVariables.md
Last active August 29, 2015 14:26
Hidden Mac OS X Environment Variables

Mac OS X Environment Variables

While there are many guides on how to set and edit Mac OS X environment variables, there are some programs that add variables to your $PATH in Mac OS X that normally don't even notify that they've changed your path, simply because they expect to be needed in the path, or because other programs won't function without them there. Regardless, while you COULD use ~/.MacOSX/environment.plist, ~/.bashrc, or ~/.profile, you should always be aware of the /etc/paths & /etc/paths.d/ entries. These are simply text files with listings of directories, one per line, to append to the $PATH variable.

I noticed that my $PATH was a bit cluttered and unnessessarily long when I ran echo $PATH, seeing locations that didn't exist and programs that I've either removed or updated. From what I can tell, only Mac OS X does this, and Apple does't even mention it in their [documentation](https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/E

Terminal Speedup on Mac OS X

If the terminal app is starting slowly, use this command (when the terminal does open up) to help speed it up: sudo rm -rf /private/var/log/asl/*.asl. This will also speed up MacVim's startup.

@lewdlime
lewdlime / BuildConfigurations.md
Last active March 2, 2016 18:24
Notes for building Git from source tarball or repository

Build Configurations

If you're building Git from it's latest source tarball or from the repository, remember to not use --with-shell="shell" if building with ./configure. Or at least don't use ZSH as the shell specified. Different shells cause errors due to differences in how variables are set and used during the build chain.

@lewdlime
lewdlime / CustomIterable.cls
Last active December 19, 2018 16:07
Salesforce Pagination Demo
global class CustomIterable implements Iterator<List<RecordWrapper>> {
// NOTE: 'Record' should be replaced with the API name of the object you want to have
// pagination for.
// The Iterator interface is used for pagination
List<RecordWrapper>InnerList {get; set;}
// Holds all the values
List<RecordWrapper>ListRequested {get; set;}
// Holds the value to be displayed on the Page
Integer i {get; set;}