Skip to content

Instantly share code, notes, and snippets.

View floydpink's full-sized avatar

Hari Pachuveetil floydpink

View GitHub Profile
@floydpink
floydpink / time_ago.sh
Last active July 21, 2021 19:58 — forked from BuonOmo/time_ago.sh
Time ago in words within bash
#!/usr/bin/env bash
# Copyright (c) 2019 Ulysse Buonomo <buonomo.ulysse@gmail.com> (MIT license)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@floydpink
floydpink / load-external-script-snippet.js
Last active April 13, 2017 03:03 — forked from cou929/load-external-script-snippet.js
Simple code snippet for loading external script from a bookmarklet.
/**
* load-external-script-snippet.js
* Kosei Moriyama <cou929@gmail.com>
*
* Simple code snippet for loading external script from a bookmarklet.
* Replace example url of script to your target script url before use.
*/
(function() {
var u = 'http://example.com/bookmarklet.js';
@floydpink
floydpink / app.html
Created February 2, 2017 22:31 — forked from hfitzwater/app.html
Aurelia Validation Demo
<!--
__ __ _ _ _ _ _ _____ _
\ \ / / | (_) | | | | (_) / ____| |
\ \ / /_ _| |_ __| | __ _| |_ _ ___ _ __ | | | |__ __ _ _ __ __ _ ___ ___
\ \/ / _` | | |/ _` |/ _` | __| |/ _ \| '_ \ | | | '_ \ / _` | '_ \ / _` |/ _ \/ __|
\ / (_| | | | (_| | (_| | |_| | (_) | | | | | |____| | | | (_| | | | | (_| | __/\__ \
\/ \__,_|_|_|\__,_|\__,_|\__|_|\___/|_| |_| \_____|_| |_|\__,_|_| |_|\__, |\___||___/
__/ |
|___/
@floydpink
floydpink / app.html
Created July 11, 2016 22:43 — forked from jdanyow/app.html
How to conditionally display client-side data with Aurelia
<template>
<ul>
<li repeat.for="obj of data" if.bind="obj.customDataType">
<span>${obj.customDataType.cdt}</span> -
<strong repeat.for="cda of obj.customDataArray">${cda}, </strong>
</li>
<li repeat.for="obj of data" if.bind="!obj.customDataType">
<span>No CustomDataType</span> -
<strong repeat.for="cda of obj.customDataArray">${cda}, </strong>
</li>
@floydpink
floydpink / UISwiftRestDemo.swift
Created November 12, 2015 19:15 — forked from cmoulton/UISwiftRestDemo
Quick & dirty REST API calls with Swift. See http://grokswift.com/simple-rest-with-swift/
// MARK: Using NSURLSession
// Get first post
let postEndpoint: String = "http://jsonplaceholder.typicode.com/posts/1"
guard let url = NSURL(string: postEndpoint) else {
print("Error: cannot create URL")
return
}
let urlRequest = NSURLRequest(URL: url)
@floydpink
floydpink / travis-secure-key-mac.sh
Last active March 6, 2021 22:18 — forked from lukewpatterson/gist:4242707
Generating secure environment variables for GitHub deployment keys to be used from a Travis-CI build.
# On a Mac, use this script to generate secure deployment key
# To generate secure SSH deploy key for a github repo to be used from Travis
base64 --break=0 ~/.ssh/id_rsa_deploy > ~/.ssh/id_rsa_deploy_base64
ENCRYPTION_FILTER="echo \$(echo \"- secure: \")\$(travis encrypt \"\$FILE='\`cat $FILE\`'\" -r floydpink/harimenon.com)"
# If you don't have homebrew please install it from http://brew.sh/
brew install coreutils
gsplit --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_deploy_base64 id_rsa_
# To reconstitute the private SSH key from within the Travis-CI build (typically from 'before_script')