Skip to content

Instantly share code, notes, and snippets.

View thesparrow's full-sized avatar
🏠
Working from home

Anna thesparrow

🏠
Working from home
  • Los Angeles
View GitHub Profile
@marchawkins
marchawkins / get-weather.html
Created March 9, 2014 08:17
Use the OpenWeatherMap api to retrieve current weather conditions by providing an address or latitude and longitude. Uses the OpenWeatherMap API (http://openweathermap.org/) to get the data. Data is returned in JSON format. For this test, input an address and hit the "Get Weather" button. The current weather conditions will be shown in the texta…
<div class="row">
<div class="col-md-2 col-sm-2 col-xs-2">
<p><button class="btn btn-primary btn-sm" id="get-weather-btn"><span>Get Weather</span></button></p>
</div><!-- .col -->
<div class="col-md-10 col-sm-10 col-xs-10">
<div class="panel panel-default">
<div class="panel-heading">OpenWeatherMap API Response</div>
<div class="panel-body">
<p>Enter Address: <input type="text" id="address" class="form-control" placeholder="City, State"/></p>
<textarea id="weather" class="form-control"></textarea>
@cgkio
cgkio / dir_list.js
Created September 23, 2013 14:55
Getting a directory listing using the fs module in Node.js
#!/usr/bin/env node
var fs = require("fs"),
path = require("path");
var p = "../"
fs.readdir(p, function (err, files) {
if (err) {
throw err;
}
@hectorcorrea
hectorcorrea / webserver.js
Last active November 17, 2022 19:54
web server in node.js
// A very basic web server in node.js
// Stolen from: Node.js for Front-End Developers by Garann Means (p. 9-10)
var port = 8000;
var serverUrl = "127.0.0.1";
var http = require("http");
var path = require("path");
var fs = require("fs");
var checkMimeType = true;
@rachelandrew
rachelandrew / smashing-template.md
Last active January 15, 2023 23:31
Template for Smashing Magazine authors

Authors Guide: Article Template

Please submit your article including all of the information below. You can include this as a seperate file if you like - but please complete each section. Please use an online service to write your article, for example Dropbox Paper, Draft.in, Google Docs. For more help, see the editorial guide

Article Title

Ideally under 67 characters, what problem does this article solve?

Quick Summary

@silverliebt
silverliebt / phpmailer example.php
Last active May 5, 2023 08:31
Example setup of phpmailer using vars (from session vars) on conversion page.
<?php
/**
* PHPMailer
* @package phpmailer
* @version $Id$
*/
require 'phpmailer/class.phpmailer.php';
try {
@jagrosh
jagrosh / WebhookTutorial.md
Last active December 4, 2023 20:28
Simple Webhook Tutorial (Twitter -> Discord)

Simple Webhook Tutorial

In this tutorial, I will be explaining how to set up a simple webhook to relay your tweets to a Discord channel

Step 1 - Register on Zapier

  1. Go to https://zapier.com/ and create an account (if you don't already have one).

Step 2 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send Tweets
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active January 21, 2024 16:28
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active April 4, 2024 02:00
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",