Skip to content

Instantly share code, notes, and snippets.

@bwiggs
bwiggs / init.vim
Last active June 3, 2022 13:43
nvim config
call plug#begin()
" language helpers
Plug 'dense-analysis/ale'
Plug 'scrooloose/syntastic'
Plug 'tpope/vim-surround'
"Plug 'easymotion/vim-easymotion' " \\s to search for a character
Plug 'phaazon/hop.nvim'
$(document).ready(function () {
var $loginBtn = $('#login');
var $signInView = $('.sign-in-view');
var $imageResultsView = $('.image-results-view');
// initialize the SDK with our API key
_500px.init({
sdk_key: '8626d07001b7482e7707a6248a3b28bcaf22fd23'
});
window.addEventListener('load', function() {
var githubBtn = document.getElementById('github');
var otherBtn = document.getElementById('other');
otherBtn.addEventListener('click', function() {
getUrl('http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=robots');
});
githubBtn.addEventListener('click', function() {
getUrl('https://api.github.com/users/bwiggs');
#!/usr/bin/env python
# Dependencies:
# sudo apt-get install -y python-gobject
# sudo apt-get install -y python-smbus
import time
import signal
import dbus
import dbus.service
var pokemonDex = [
'pikachu',
'squirttle',
'bulbasaur'
];
links: [
]
@bwiggs
bwiggs / .eslintrc
Created June 23, 2016 10:17
JavaScript Standard Style Relaxed
{
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},

http://codepen.io/anon/pen/zqbpNO?editors=0010

Printing Stuff out

As developers we need to be able to interact with out object and see what's going on inside them. We can use a console.log to get data out of the code we write.

var name = 'brian';
console.log("Hello, ", name);
@bwiggs
bwiggs / gist:151a02b50474a7db88ff
Created February 19, 2016 23:02
Find unused directives
#!/usr/bin/env bash
directives=(app-title appetite-toolbar appointment-btn appointment-label appointments-widget auto-focus checklist-filter-group click-to-edit company-card company-list company-logo company-tiles company-typeahead company-typeahead-card compile connection-btn connection-count connections-widget conversation-thread document-click-listener ev-validated-field ev-validated-form evsr-ensure-url expandable-section filter-box guide-member-list iconic industries-selector industry-item industry-sidebar-filter-group inline-login invite-widget line-break-title load-more-button market-appetite-company market-appetite-header market-appetite-product market-appetite-search-form market-appointment-btn market-company market-company-logo market-search-filters market-search-tuning mcglades-search-result member-card member-location member-title member-typeahead member-typeahead-card milestone-nav most-recent-widget navbar-collapse-mobile ng-enter on-finish-render policy-card policy-list product-label product-p
@bwiggs
bwiggs / checkmail.py
Last active September 10, 2023 07:27
For use on a raspberry pi. - Checks a gmail account for any unread messages. If there's a message then it turns on a red LED, if there are no emails then it shows a green led.
#!/usr/bin/env python
from imapclient import IMAPClient
import time
import RPi.GPIO as GPIO
DEBUG = True
HOSTNAME = 'imap.gmail.com'
@bwiggs
bwiggs / insure.rb
Last active November 11, 2015 20:20
Insurance Company Name Generator
# Example Output
#
# Atlantic Federated states of micronesia Casualty Freedom Services
# Midcontinental Kansas Casualty Holdings Capital
# Coastal Iowa Casualty Specialty Freedom
# Pacific New mexico Fire & marine Freedom Center
# America Ohio Marine Limited Limited
# Midcontinental Connecticut Marine Capital Holdings
# Midwest Citizens Indemnity Assurance Partners
# Midwest Palau Property Corporation Group