Skip to content

Instantly share code, notes, and snippets.

View VacantFuture's full-sized avatar

James Nobles VacantFuture

  • NNY Digital
  • Potsdam, NY
View GitHub Profile
@joshnuss
joshnuss / httpStore.js
Last active October 11, 2023 11:29
A Svelte store backed by HTTP
import { writable } from 'svelte/store'
// returns a store with HTTP access functions for get, post, patch, delete
// anytime an HTTP request is made, the store is updated and all subscribers are notified.
export default function(initial) {
// create the underlying store
const store = writable(initial)
// define a request function that will do `fetch` and update store when request finishes
store.request = async (method, url, params=null) => {
@loopiezlol
loopiezlol / git-lambda.js
Created April 10, 2018 14:12
flow showing off how to clone, update and push to a git repo from an AWS lambda function
const fs = require('fs')
const path = require('path')
const process = require('process')
const { spawnSync } = require('child_process')
const { GITHUB_TOKEN, GITHUB_USERNAME, GITHUB_EMAIL } = process.env
// leaving this without https:// in order to reuse it when adding the remote
const gitRepositoryURL = 'github.com/owner/repo-name.git'
const repositoryName = 'repo-name'
@dot1q
dot1q / telnet-cms-e7-remote-timer.sh
Last active February 22, 2019 12:48
Telnet into CMS, Connect to E7(or other device) stack and open the remote timer on an ONT
#!/usr/bin/expect
set ont [lindex $argv 0]
# Arg is the ONT Profile number
set timeout 20
spawn telnet 10.10.10.10 9199
#The script expects login
expect ">"
@hemantajax
hemantajax / media-queries.css
Last active March 2, 2024 07:05
Very useful media queries snippets
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@caseyohara
caseyohara / index.html
Created September 18, 2011 06:46
TurfKit Demo markup and data
<!DOCTYPE html>
<html lang="en">
<head>
<title>TurfKit - Demo</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<link rel="stylesheet" href="/lib/turf/turfkit.css" type="text/css" />
<script src="/lib/turf/turfkit.js"></script>