Skip to content

Instantly share code, notes, and snippets.

View ramsaylanier's full-sized avatar

Ramsay Lanier ramsaylanier

View GitHub Profile
@ramsaylanier
ramsaylanier / manifest.json
Last active August 29, 2015 14:22
Manifest File for PushQuotes
{
"manifest_version": 2,
"name": "PushQuotes",
"description": "Authenticate to PushQuotes and sync with Slides.com",
"version": "1.0",
"permissions": [
"declarativeContent",
"tabs",
@ramsaylanier
ramsaylanier / popup.js
Created May 30, 2015 18:05
PushQuotes Popup.js
$(function() {
chrome.runtime.sendMessage({}, function(response){
console.log(response.started);
if (response.started){
hideForm();
}
});
@ramsaylanier
ramsaylanier / loginFromExtension.js
Last active August 29, 2015 14:22
loginFromExtension for PushQuotes
//loctaed in 'server' folder.
Meteor.methods({
loginFromExtension: function(username, password){
try {
if (ApiPassword.isPasswordValid(username, password)) {
console.log('password is valid for this user');
return true;
} else {
return 'Password is not valid.'
}
@ramsaylanier
ramsaylanier / background.js
Last active December 17, 2017 23:55
Setup Page Action on Certain URLS
chrome.runtime.onInstalled.addListener(function() {
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
chrome.declarativeContent.onPageChanged.addRules([
{
conditions: [
new chrome.declarativeContent.PageStateMatcher({
pageUrl: { urlContains: 'slides.com' },
})
],
actions: [
@ramsaylanier
ramsaylanier / _headings.jsx
Last active October 5, 2018 14:19
React Heading Components
const headingsArray = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
const headingsStyles = {
base: {
textRendering: "optimizeLegibility",
lineHeight: 1,
marginTop: 0,
color: "#222",
fontFamily: Fonts.serif,
},
<div class="application">
<img id="image" src="/commnity.gif"/>
<div id="section-1" class="page-section"></div>
<div id="section-2" class="page-section"></div>
<div id="section-3" class="page-section"></div>
<div id="section-4" class="page-section"></div>
</div>
<script type="text/javascript">
'use strict';
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var WriteFilePlugin = require('write-file-webpack-plugin');
const devServer = {
contentBase: path.resolve(__dirname, './app'),
/* eslint no-console: 0 */
import express from 'express';
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import webpackMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import config from './webpack.config.js';
import { apolloServer } from 'apollo-server';
import Schema from './schema/typeDefinitions';
import Resolvers from './schema/resolveFunctions';
@ramsaylanier
ramsaylanier / resolveFunctions.js
Created June 30, 2016 01:53
Resolver Functions for WordExpress
import Connectors from './connectors';
import { publicSettings, privateSettings } from '../settings/settings';
const resolveFunctions = {
Query: {
settings(){
return publicSettings
},
posts(_, args){
return Connectors.getPosts(args).then( res=> {