Skip to content

Instantly share code, notes, and snippets.

View aarmora's full-sized avatar

Jordan Hansen aarmora

View GitHub Profile
@aarmora
aarmora / SassMeister-input-HTML.html
Created July 7, 2015 13:55
Generated by SassMeister.com.
<div class="admin_page">
<textarea></textarea>
</div>
@aarmora
aarmora / SassMeister-input-HTML.html
Last active August 29, 2015 14:24
Generated by SassMeister.com.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<style>
.admin_page textarea {
height: 200px;
}
</style>
<div class="admin_page">
<div>
<div class="form-group">
import * as mongoose from "mongoose";
export interface LSClass {
create: Boolean;
delete: Boolean;
}
export interface LS {
class: LSClass;
}
@Injectable()
export class AccountService {
constructor(
private http: Http) {
// This allows the cookie to be set and sent.
// It appears that once the cookie is set with login, it works for each call (even in other services)
let _build = (<any>http)._backend._browserXHR.build;
(<any>http)._backend._browserXHR.build = () => {
let _xhr = _build();
import {
it,
inject,
describe,
beforeEach,
beforeEachProviders,
expect,
} from '@angular/core/testing';
import { BaseRequestOptions, Response, ResponseOptions, Http } from '@angular/http';
import { MockBackend, MockConnection } from '@angular/http/testing';
import {
Component,
NgModule,
Input,
Output,
EventEmitter,
forwardRef,
ModuleWithProviders
} from '@angular/core';
import { NG_VALUE_ACCESSOR, ControlValueAccessor, FormsModule, ReactiveFormsModule } from '@angular/forms';
<input
[id]="id ? id : ''"
[type]="type"
[placeholder]="placeholder ? placeholder : ''"
[attr.name]="name"
[tabIndex]="tabIndex ? tabIndex : ''"
[checked]="checked !== undefined ? checked : ''"
[required]="required"
(focus)="focus.emit($event); isFocused = true;"
(blur)="blur.emit($event); isFocused = false;"
@aarmora
aarmora / audible-library-scraper.js
Last active July 12, 2017 01:12
Just paste this into the console of your audible library and run it and it will compile an object of basic information of all the books (shown) in your library. This is brittle and depends on their html structure remaining the same. If they change it, this could no longer work.
let tables = document.getElementsByTagName('table');
let rows = tables[2].getElementsByTagName('tr');
let books = [];
for (let i = 0; i < rows.length; i++) {
try {
// It's generally a normal row if there is a fourth cell
if (rows[i].cells[3]) {
let url = rows[i].cells[3].children[0].href;
let title = rows[i].cells[3].children[0].innerText;

Getting started

Download these

Visual Studio Code

This will be how we will edit the code. It's lightweight and pretty awesome.

Node JS

@aarmora
aarmora / smurf_checker.py
Created April 8, 2019 20:58
Returns indicative information of if a user is using the same account as another or not
import requests
import datetime as dt
import requests
first_user = '80623424'
second_user = '887227975'
def get_intervals(l):