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
@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

@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");
@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
@vasanthk
vasanthk / System Design.md
Last active April 26, 2024 18:05
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@gokulkrishh
gokulkrishh / media-query.css
Last active April 26, 2024 10:32
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@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"});
@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>
@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 {
@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;
}
@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).