Skip to content

Instantly share code, notes, and snippets.

View jameshahn2's full-sized avatar

James Hahn II jameshahn2

View GitHub Profile
@jameshahn2
jameshahn2 / news-locations.py
Created December 6, 2019 08:26 — forked from coblezc/news-locations.py
Extract locations mentioned in articles on front page of nytimes.com
from __future__ import unicode_literals
from bs4 import BeautifulSoup
import urllib
from selenium import webdriver
import time
import spacy
from twython import Twython
import json
# "loadin' the pipeline"
@jameshahn2
jameshahn2 / components.my-groups.js
Last active August 30, 2019 00:27 — forked from kumkanillam/components.my-posts.js
Discipline - Groups
import Ember from 'ember';
export default Ember.Component.extend({
disciplineGroups: Ember.computed('discipline', function(){
return this.get('disciplines').filter(discipline => discipline.disciplineId === this.get('discipline'));
})
/*
groupsFiltered: Ember.computed('discipline', 'search', function () {
@jameshahn2
jameshahn2 / controllers.application.js
Last active August 26, 2019 01:18 — forked from runspired/components.each-chunk.js
Alphabetical Table Grids
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@jameshahn2
jameshahn2 / components.choose-topic.js
Created August 23, 2019 00:08 — forked from jenweber/components.choose-topic.js
What are Controllers For? Demo
import Ember from 'ember';
export default Ember.Component.extend({
});
import Component from '@ember/component';
import { computed } from '@ember/object';
export default Component.extend({
mouseEnter() {
this.setActiveItems(this);
},
mouseLeave() {
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
calculatePosition(trigger, content) {
let { top, left, width } = trigger.getBoundingClientRect();
let { height: contentHeight } = content.getBoundingClientRect();
let style = {
left: left + width + contentHeight,
import Component from "@ember/component";
import computedStyle from "ember-computed-style";
export default Component.extend({
style: computedStyle("backgroundStyle"),
backgroundStyle: {
backgroundColor: "red"
},
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@jameshahn2
jameshahn2 / config.js
Last active October 5, 2018 00:03
Glossary App
export default function() {
this.namespace = '/api';
let terms = [
{
url: "https://www.glossary.oilfield.slb.com/en/Terms/c/coal-seam_gas.aspx",
term: "coal-seam gas",
definitions: [
{
speech_type: "n.",
@jameshahn2
jameshahn2 / adapters.application.js
Last active October 4, 2018 21:17 — forked from chrism/adapters.application.js
Filtering Async hasMany Relationships
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
namespace: 'api',
//coalesceFindRequests: true
});