Skip to content

Instantly share code, notes, and snippets.

View Kikobeats's full-sized avatar
👋
say hi

Kiko Beats Kikobeats

👋
say hi
View GitHub Profile
@zachharkey
zachharkey / _media-object.scss
Last active December 15, 2015 07:29 — forked from Victa/_media-object.scss
A SASS(SCSS) Mixin to easily apply the [OOCSS Media object][stubbornella] to any component. Implements the code from this [Gist][github] which I forked from [Victa][github 2] to provide more SMACSS friendly default class names and reordered the arguments in based on my own frequency of use. [See it in action][codepen] [github]: https://gist.gith…
// OOCSS Media Object
@mixin media-object($img: '.media-img', $bd: '.media-bd', $margin:10px, $position: left, $formatting-context: 'overflow') {
@include pie-clearfix; // or extend a .clearfix class
#{unquote($bd)} {
@if $formatting-context == 'overflow' {
overflow:hidden;
} @else {
display:table-cell;
width:10000px;
*width:auto;
@Kikobeats
Kikobeats / readable-pattern.js
Last active March 17, 2016 12:28
Pattern to create a Readable Stream
// Example based in Substack Stream Handbook:
// https://github.com/substack/stream-handbook#creating-a-readable-stream
'use strict'
var inherits = require('inherits')
var duplexify = require('duplexify')
var Stream = require('readable-stream').Stream
var CONST = {
@stt
stt / sqlaus.jison
Created October 18, 2011 21:15
Jison rules for turning boolean expressions into SQL clauses
/*
* Jison rules for parsing simple boolean expressions
* (c)2011, <samuli@tuomola.net>
*
* Usage: npm install jison && jison sqlaus.jison && node test-sqlaus.js
*
* Meant primarily for generating SQL clauses for m:m table structure.
*
* Depends on shared scope to provide..
* functions:
anonymous
anonymous / index.html
Created December 13, 2016 11:19
Presentation
<!DOCTYPE html>
<html>
<head>
<title>Foo</title>
<meta charset='utf-8' />
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' />
<style type='text/css'>
body {
font-family: 'Helvetica';
letter-spacing:-5px;
@mikermcneil
mikermcneil / outcome-oriented-programming.md
Last active July 13, 2017 14:34
Outcome Oriented Programming - Software as a plan

Outcome-Oriented Programming

Mike McNeil, Aug 2014

Humans are not very good at planning. We have no problem running scenarios, thinking through possibilities, and pondering "what if?" questions. I might plan to not eat my cousin's birthday cake before she gets home, for instance. If I'm very serious, I might write down my commitment; or if I'm unsure about the pros and cons, use some organizational tool like a T-chart.

But when it comes to making a decision in the moment, all bets are off. The cake is a goner.

Predictive Analysis vs. Process Design

Below, I've included a figure containing a decision tree diagram.

@nanonanomachine
nanonanomachine / es6-fizzbuzz.js
Created August 11, 2015 01:46
ES6 Generator FizzBuzz
let fizzbuzz = function*(){
for (var val = 1; val < 100; val++) {
if(val % 15 === 0){
yield "FizzBuzz";
}
else if(val % 3 === 0){
yield "Fizz";
}
else if(val % 5 === 0){
yield "Buzz";
@demonixis
demonixis / detect_gpu.js
Last active June 25, 2020 22:44
Gets the user's GPU name using the `WEBGL_debug_renderer_info` WebGL extension. It returns a `string` with the graphics card name or `unknow` if the extension is not supported.
function getGraphicsCardName() {
var canvas = document.createElement("canvas");
var gl = canvas.getContext("experimental-webgl") || canvas.getContext("webgl");
if (!gl) {
return "Unknow";
}
var ext = gl.getExtension("WEBGL_debug_renderer_info");
if (!ext) {
@data-enhanced
data-enhanced / vs-code-turnoff-autocomplete.json
Last active October 3, 2020 03:18
Turn off autocompletion (intellisense) in MS Visual Studio Code
// Turn off autocomplete in Visual Studio Code
// http://code.visualstudio.com/
// Add the following lines to user settings
// OPTIONAL WORD WRAPPING
// Controls if lines should wrap. The lines will wrap at min(editor.wrappingColumn, viewportWidthInColumns).
"editor.wordWrap": true,
// Controls the indentation of wrapped lines. Can be one of 'none', 'same' or 'indent'.
"editor.wrappingIndent": "indent",
@nicoandmee
nicoandmee / monitorExecution.js
Created November 9, 2019 13:54
inject js to examine detection strategies
const fingerprintingDetection = (function () {
const detectFingerprinting = function () {
function getCallerFile() {
let originalFunc = Error.prepareStackTrace;
let callerfile;
try {
const err = new Error();
let currentfile;

A Modest Proposal: Events

Sails.js v0.10

Events are a new feature of the Sails core as of 0.9.

Core events

Lifecycle