Skip to content

Instantly share code, notes, and snippets.

💻
Always coding

Jamie Perkins inorganik

Block or report user

Report or block inorganik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@inorganik
inorganik / cloudSettings
Created Apr 15, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-04-15T20:38:11.599Z","extensionVersion":"v3.2.8"}
@inorganik
inorganik / euroCountries.js
Created Mar 5, 2019
A javascript array of country codes using the Euro €
View euroCountries.js
const euroCountries = [
'BE', // Belgique/België Belgium Belgique Belgien
'BG', // Bulgarija Bulgaria Bulgarie Bulgarien
'CZ', // Česko Czechia Tchéquie Tschechien
'DK', // Danmark Denmark Danemark Dänemark
'DE', // Deutschland Germany Allemagne Deutschland
'EE', // Eesti Estonia Estonie Estland
'IE', // Éire/Ireland Ireland Irlande Irland
'EL', // Elláda Greece Grèce Griechenland
'ES', // España Spain Espagne Spanien
@inorganik
inorganik / countUp-jquery.js
Created Feb 21, 2019
A CountUp extension for jQuery
View countUp-jquery.js
// Dependency: CountUp.js: https://github.com/inorganik/CountUp.js
(function ($) {
$.fn.countup = function (params) {
// make sure dependency is present
if (typeof CountUp !== 'function') {
console.error('countUp.js is a required dependency of countUp-jquery.js.');
return;
}
@inorganik
inorganik / confetti.directive.ts
Created Jan 29, 2019
An Angular directive around dom-confetti
View confetti.directive.ts
import { Directive, ElementRef, OnInit, Input, HostListener } from '@angular/core';
import { confetti } from 'dom-confetti';
interface ConfettiConfig {
angle: number; // - direction of the explosion in degrees, defaults to 90.
spread: number; // - spread of the explosion in degrees, deafults to 45.
startVelocity: number; // - Initial velocity of the particles, defaults to 45.
width: number; // - width of the confetti elements
height: number; // - height of the confetti elements
elementCount: number; // - Number of particle elements, defaults to 50.
@inorganik
inorganik / TungPlayer.m
Last active Dec 13, 2018
Player code for Tung - a social podcast player for iOS
View TungPlayer.m
/* These are methods extracted from a singleton class i used called
"TungCommonObjects". I didn't include the properties just
the methods concerned with playing and caching audio.
This file acted as NSURLConnectionDataDelegate, AVAssetResourceLoaderDelegate.
It is broken into the following parts, separated by pragma marks.
- Player Instance methods
- caching/saving episodes
- NSURLConnection delegate
@inorganik
inorganik / cloudSettings
Created Oct 15, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-10-15T22:15:03.430Z","extensionVersion":"v3.1.2"}
@inorganik
inorganik / bash_profile.sh
Created Aug 22, 2018
nvmrc hook for bash profile
View bash_profile.sh
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
enter_directory() {
if [[ $PWD == $PREV_PWD ]]; then
return
fi
PREV_PWD=$PWD
@inorganik
inorganik / email-subscribe-form.component.ts
Last active Oct 9, 2018
MailChimp subscribe form with Angular 5 using jsonp
View email-subscribe-form.component.ts
import { Component } from '@angular/core';
import { FormControl, Validators } from '@angular/forms';
import { HttpClient, HttpParams } from '@angular/common/http';
interface MailChimpResponse {
result: string;
msg: string;
}
@Component({
@inorganik
inorganik / Markdown_colors.md
Last active Jan 8, 2018
How can you hack markdown into displaying colors?
View Markdown_colors.md
+ this will be highlighted in green
- this will be highlighted in red

Inline colors? diff - red Probably doesn't work

@inorganik
inorganik / ImageCacher.swift
Created Sep 4, 2017
returns image data by fetching locally or remote, caching the result so subsequent fetches are local
View ImageCacher.swift
func getImageDataWithUrlString(imageUrlString: String) -> NSData? {
let url = URL(string: imageUrlString)
if let filename: String = url?.lastPathComponent {
let imagesDirUrl = try! FileManager.default.url(for: .cachesDirectory, in: .localDomainMask, appropriateFor: nil, create: true)
let fileUrl = imagesDirUrl.appendingPathComponent(filename)
do {
// get a cached copy
let _ = try fileUrl.checkResourceIsReachable()
let imageData = NSData(contentsOf: fileUrl)
You can’t perform that action at this time.