Skip to content

Instantly share code, notes, and snippets.

@codephobia
codephobia / example.animation.ts
Created August 20, 2019 19:25
Example Angular animations toggle
import {
trigger,
transition,
style,
animate,
query,
group,
useAnimation,
animation
} from '@angular/animations';
@codephobia
codephobia / main.go
Created November 24, 2018 10:03
Josephus Permutation
package kata
func Josephus(items []interface{}, k int) []interface{} {
out := []interface{}{}
cnt := 0
last := 0
for len(items) > 0 {
for i, _ := range items {
if i < last {
@codephobia
codephobia / # libpng - 2016-12-05_14-22-33.txt
Created December 5, 2016 22:23
libpng on macOS 10.11.6 - Homebrew build logs
Homebrew build logs for libpng on macOS 10.11.6
Build date: 2016-12-05 14:22:33
@codephobia
codephobia / preloader.js
Created December 1, 2015 20:17
An updated version of Ben Nadel's awesome Angularjs preloader service that adds audio preloading.
app.factory('Preloader', ['$q', '$rootScope',
function( $q, $rootScope ) {
// I manage the preloading of file objects. Accepts an array of file URLs.
function Preloader( fileLocations ) {
// I am the file SRC values to preload.
this.fileLocations = fileLocations;
// As the files load, we'll need to keep track of the load/error
// counts when announing the progress on the loading.
this.fileCount = this.fileLocations.length;
this.loadCount = 0;