Skip to content

Instantly share code, notes, and snippets.

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

William Lepinski wlepinski

🏠
Working from home
View GitHub Profile
@Rich-Harris
Rich-Harris / service-workers.md
Last active June 14, 2024 06:20
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@chrisblackwell
chrisblackwell / post-receive-for-laravel.sh
Last active May 5, 2022 22:40
Git Post receive hook for Laravel deployment
#!/bin/sh
WEBROOT=/srv/www/apps.legendboats.com
GIT_WORK_TREE=$WEBROOT git checkout -f
cd $WEBROOT
# Check if a composer.json file is present
if [ -f composer.json ]; then
# Install or update packages specified in the lock file
composer install
@joseraya
joseraya / snapshot-crawler.js
Created January 21, 2014 20:15
A node script that crawls a web site and stores snapshots (taken with zombie.js) to the file system. Based on code from this article: http://www.ng-newsletter.com/posts/serious-angular-seo.html
var Browser = require('zombie'),
url = require('url'),
fs = require('fs'),
$q = require('Q'),
saveDir = __dirname + '/_snapshots';
var scriptTagRegex = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
var stripScriptTags = function(html) {
@FrankHassanabad
FrankHassanabad / AdvancedRestClientOAuth2orize.md
Last active July 22, 2019 09:10
Using Advanced Rest Client with OAuth2orize's example

Advanced Rest Client with OAuth2orize

For this to work you will need to install the Advanced Rest Client for some of these steps. Of course you will need to install OAuth2orize as well.

Run the oauth2orize provider/server example which does server-side OAuth flow:

cd oauth2orize\examples\express2
node app.js
@mikevansnell
mikevansnell / invite.js
Last active October 22, 2018 21:04
Parse.com cloudcode sample that enables one user to invite another user, and immediately returns the new user object so that you can do something with it (e.g. start associating objects with it).
// in invite.js module:
exports.inviteUser = function(creatingUser,email,tempPass,response)
{
"use strict";
if (!tempPass) {
tempPass = genRandomPass();
}
var user = new Parse.User();
user.set ("username", email);
<html ng-app="application" preloader="splash">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Preloader Experiment</title>
<script src="http://code.angularjs.org/angular-1.0.0rc10.min.js"></script>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="preloader-0.0.1.js"></script>
package org.swizframework.extensions.commands
{
import flash.events.Event;
import flash.utils.Dictionary;
import org.swizframework.core.Bean;
import org.swizframework.core.ISwiz;
import org.swizframework.core.ISwizAware;
import org.swizframework.core.Prototype;