Skip to content

Instantly share code, notes, and snippets.

View AlexSwensen's full-sized avatar

Alexander Swensen AlexSwensen

View GitHub Profile
@AlexSwensen
AlexSwensen / gist:5bc7803ca53c060ebafc
Created September 29, 2015 19:46
Ionic slide box example with ng-repeat
<ion-slide-box class="has-header" active-slide="activeSlide">
<ion-slide ng-repeat="image in images">
<ion-scroll direction="xy" scrollbar-x="false" scrollbar-y="false"
zooming="true" min-zoom="{{ zoomMin }}" style="width: 100%; height: 100%"
delegate-handle="scrollHandle{{$index}}" on-scroll="updateSlideStatus(activeSlide)"
on-release="updateSlideStatus(activeSlide)">
<!-- content here -->
@AlexSwensen
AlexSwensen / pinch-zoom-directive.js
Created October 7, 2015 01:11 — forked from ktknest/pinch-zoom-directive.js
pinch zoom in/out directive for AngularJS
// sample: http://codepen.io/ktknest/full/LDljw/
angular.module('app', [])
/**
* @ngdoc directive
* @name pinchZoom
* @restrict A
* @scope false
*
* @description

Keybase proof

I hereby claim:

  • I am alexswensen on github.
  • I am alexswensen (https://keybase.io/alexswensen) on keybase.
  • I have a public key ASDisJ_B5nXGtEhH1vVm54yqch1aNtdsZ8OhNOhvSbNJJAo

To claim this, I am signing this object:

@AlexSwensen
AlexSwensen / GitHub-Forking.md
Created May 17, 2017 03:05 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@AlexSwensen
AlexSwensen / raspbian-python3.6.rst
Last active May 23, 2017 17:44 — forked from dschep/raspbian-python3.6.rst
Installing Python 3.6.1 on Raspbian

Installing Python 3.6.1 on Raspbian =================================

As of January 2017, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).

$scope.scanCode = function () { // Scan code
$ionicLoading.show({
template: '<ion-spinner></ion-spinner>'
});
console.log("scanCode run");
if ($scope.currentlyScanning === true) {
$ionicLoading.hide();
return;
}
else if (ionic.Platform.platforms.indexOf("browser") !== -1) {
@AlexSwensen
AlexSwensen / settings.json
Created November 18, 2022 01:07
a full copy of my local settings. I set these globally for me.
{
"window.autoDetectColorScheme": true,
"workbench.preferredDarkColorTheme": "One Dark Pro",
"workbench.iconTheme": "vscode-icons",
"git.autofetch": true,
"editor.bracketPairColorization.enabled": true,
"files.autoSave": "onFocusChange",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
@AlexSwensen
AlexSwensen / node-typescript-esm.md
Created November 21, 2023 16:52 — forked from khalidx/node-typescript-esm.md
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@AlexSwensen
AlexSwensen / get-posts.ts
Last active February 27, 2024 20:48
an example for getting posts - refactored to be functional
import fs from 'fs';
import path from 'path';
import matter from 'gray-matter';
export default async () => {
const posts = await readMarkdownFiles();
return {
data: { posts }
};
};