Skip to content

Instantly share code, notes, and snippets.

View Matt-Jensen's full-sized avatar
🟩
GREEN SQUARE GOOD

Matt-Jensen Matt-Jensen

🟩
GREEN SQUARE GOOD
View GitHub Profile
@raghava
raghava / ngIncludeView.js
Last active August 29, 2015 14:02
ngIncludeView.js it'a alternative to ng-include, which load the view & re uses the same scope
// ng-include-view
// - directive in module ng
//
// This works similar to ng-include and it won't create new scope,
// instead it uses the same level
//
// Example usage:
// <ng-include-view src=""></ng-include-view>
@Matt-Jensen
Matt-Jensen / Sass Retina Query Mixin
Last active December 22, 2015 01:19
A sass function to generate retina media queries.
/* Update: 5/3/14 - supports IE9+, FF3.5+, Opera9.5+ */
@mixin retina($query: null, $density: 2) {
$dpi: $density * 96;
/* Accepts optional @media query conditions */
@if $query {
$query: "and (#{$query})";
}
@else {
@lsiv568
lsiv568 / dropzone.coffee
Last active September 16, 2016 12:22
This directive uses the HTML5 drag and drop spec as well as the FileReader to base64 encode the dropped files. This allows for easy client/server transfer via REST protocol.
'use strict';
angular.module('reusableThings')
.directive('fileDropzone', () ->
restrict: 'A'
scope: {
file: '='
fileName: '='
}
link: (scope, element, attrs) ->
@sanderhouttekier
sanderhouttekier / name.sublime-project
Last active September 26, 2016 21:07
Sublime Project File #snippet #sublimetext
{
"folders":
[
// add paths per directory you want to show
{
// relative paths to the root
"path": "/",
// optionally give it a different name
"name": "My Project",
// possible folders to exclude
@saintc0d3r
saintc0d3r / Detailed Steps for configuring postfix in Mac OS X Yosemite
Last active March 16, 2017 14:58
Postfix Config File for sending mail from Mac OS X Yosemite dev machine through Gmail's SMTP server
Detailed steps for the setup can be viewed in this link:
http://www.iamafishnow.com/2014/11/02/set-up-smtp-gmail-to-work-with-php-mail-on-osx-yosemite/
@bretton
bretton / improved-install.md
Last active November 15, 2019 19:35
updated & improved guide to installing LND, BTCD, on Ubuntu 16.04 Server on testnet

2018-03-18: Updating of this guide is taking a backseat to the mainnet version at

Intro

This guide is specific to btcd, lnd, on testnet, running on an ubuntu 16.04 server host.

It does not address mainnet, or using bitcoind, or neutrino.

Original installation guide is here:

To dump all IndexedDB data to console:

(() => {
  const asyncForEach = (array, callback, done) => {
    const runAndWait = i => {
      if (i === array.length) return done();
      return callback(array[i], () => runAndWait(i + 1));
    };
 return runAndWait(0);
@sarupbanskota
sarupbanskota / README.md
Last active June 9, 2020 21:28
Ember + ESLint + Prettier + Ember Suave
  • new ember app & yarn install
  • ember install ember-cli-eslint@4
// ember-cli-build.js
let app = new EmberApp(defaults, {
  eslint: {
    testGenerator: 'qunit',
    group: true,
    rulesDir: 'eslint-rules',
 extensions: ['js'],
@cskevint
cskevint / titleize.js
Created June 19, 2013 19:54
Titleize a sentence in JavaScript
function titleize(sentence) {
if(!sentence.split) return sentence;
var _titleizeWord = function(string) {
return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
},
result = [];
sentence.split(" ").forEach(function(w) {
result.push(_titleizeWord(w));
});
return result.join(" ");
@markblundeberg
markblundeberg / atomic-size-attack.md
Created February 16, 2018 05:14
Advisory: secret size attack on cross-chain hash lock smart contracts

Advisory: secret size attack on cross-chain hash lock smart contracts

Dr. Mark B Lundeberg, 2018 Feb 15 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

This security advisory notes a vulnerability in the common construction of cross-chain smart contracts (contracts between distinct cryptocurrencies) through hash locking. I focus on the primary use case in [atomic