Skip to content

Instantly share code, notes, and snippets.

View Nickersoft's full-sized avatar
🍜
在吃拉面

Tyler Nickerson Nickersoft

🍜
在吃拉面
View GitHub Profile
@Nickersoft
Nickersoft / gist:9ab1761a06bdf7eb83f5
Last active August 29, 2015 14:25
edx/ecommerce: Creating a new superuser
$ ./manage.py shell
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.auth import get_user_model
>>> User = get_user_model()
>>> user = User.objects.create_user('username', '[email protected]', 'password')
>>> user.is_staff = True
>>> user.is_superuser = True
@Nickersoft
Nickersoft / android_instructions.md
Created March 12, 2017 16:50 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Jekyll NavBar

In building a site powered by Jekyll and hosted by GitHub, I wanted the ability to highlight the current page's tab in the bar. I also wanted the bar to support second-level items (i.e. a dropdown), which proved somewhat tricky. This is the solution I arrived at after a few hours of fiddling around.

Construction

The contents of the navigation bar are contained in a data file located at _data/navigation.yml. This makes it accessible via the site-wide Liquid element {{ site.data.navigation}}. You can see the file for the formatting I used.

How it Works

@Nickersoft
Nickersoft / submodules.sh
Last active January 24, 2018 21:04
Proper Way to Remove a Git Submodule
# A lot of times people have trouble removing Git submodules, receiving errors about the index still existing in their repo even after
# they deleted the module directory. This is the correct way to do it.
# Add a submodule just so we can remove it
git submodule add https://github.com/Nickersoft/push.js.git ./data/push
# Remove the submodule from the Git cache
git rm --cached ./data/push
# Remove Git module files
### Keybase proof
I hereby claim:
* I am nickersoft on github.
* I am tnick (https://keybase.io/tnick) on keybase.
* I have a public key ASABd2Jm5PqQaSKlNhkDio86PIiPcfqgJrmfAbZdCovDowo
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am nickersoft on github.
  • I am tjnickerson (https://keybase.io/tjnickerson) on keybase.
  • I have a public key ASB_ye0nj4tgspClu5tUMpH5CkwTrmcdukY250NuODLttwo

To claim this, I am signing this object:

package blogspot.software_and_algorithms.stern_library.string;
import java.util.HashMap;
import java.util.Map;
/* Copyright (c) 2012 Kevin L. Stern
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@Nickersoft
Nickersoft / 0dedict.py
Created December 11, 2022 00:30 — forked from josephg/0dedict.py
Apple dictionaries
# Thanks to commenters for providing the base of this much nicer implementation!
# Save and run with $ python 0dedict.py
# You may need to hunt down the dictionary files yourself and change the awful path string below.
# This works for me on MacOS 10.14 Mohave
from struct import unpack
from zlib import decompress
import re
filename = '/System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/9f5862030e8f00af171924ebbc23ebfd6e91af78.asset/AssetData/Oxford Dictionary of English.dictionary/Contents/Resources/Body.data'
f = open(filename, 'rb')