Skip to content

Instantly share code, notes, and snippets.

View sgnl's full-sized avatar
🍪
Do you agree to share your cookies?

Ray Farias sgnl

🍪
Do you agree to share your cookies?
  • Honolulu, Hawaii
View GitHub Profile
@sgnl
sgnl / gist:0180cea3e7eacebd336cc39d285d0435
Created April 19, 2017 18:55 — forked from jaywon/gist:c76abc57dc33e1679c02
Circular String Brain Bender

###Good Morning Agents

Your challenge this morning is to create a function that implements an algorithm using the concepts we've covered this week.

###Challenge

  1. Write an algorithm that takes in 2 strings as parameters (source, find).
  2. Your function should return true if the string passed in as the find parameter is found in the source parameter if source were circular in nature. Meaning there is no end to the source string.
  3. Important: A match would be true if the word to find is partially at the end of the word and at the beginning in sequence.

Ex.

@sgnl
sgnl / scraper.js
Last active April 7, 2017 11:05
Scrape website's flash card data and output HTML for markdown use
const got = require('got')
const cheerio = require('cheerio')
const Promise = require('bluebird')
const fs = Promise.promisifyAll(require('fs'))
const baseUrl = 'https://[nope].com/comptia-a-exam/flashcards/902-windows-operating-systems/pages'
function getFrontCard(baseUrl, startPageNumber = 1) {
return got(`${baseUrl}/${startPageNumber}`)
.then(res => {
@sgnl
sgnl / block_family.md
Last active February 10, 2018 20:18 — forked from kellishouts/block_family.md
Block Family

Block Family

Set up:

  1. Run gulp. This project uses the Gulp + Sass + Browser-sync project boilerplate, however all of this should already be set up for you.

Media Queries/Sass Block Family Exercise:

@sgnl
sgnl / Painter.js
Last active March 27, 2017 22:44
OOP PixelPainter - an example for dev league students
class Pixel {
constructor(color, width, height) {
this.color = color;
this.element = document.createElement('div'); // public DOM access
this.element.classList.add('pixel');
/**
* styling
*/
@sgnl
sgnl / closure.md
Last active January 21, 2021 18:36
Closures - Princess Story
@sgnl
sgnl / readme.md
Created March 15, 2017 20:13
Dev League Javascript Linter Installation with XO and Sublime Linter
  1. Install/Verify you have Sublime Text 3 (http://sublimetext.com/3)

  2. Install/Verify that Package Control Module is installed to for Sublime Text: https://packagecontrol.io/installation

Linux: Click the Preferences > Browse Packages… menu Browse up a folder and then into the Installed Packages/ folder Download Package Control.sublime-package and copy it into the Installed Packages/ directory Restart Sublime Text

@sgnl
sgnl / index.js
Created September 21, 2016 18:46
Curry Calculator
// https://repl.it/Ccki/2
function calculator(num) {
var equation = [];
function captureNumber (num) {
equation.push(num);
return captureOperator;
}
@sgnl
sgnl / README.md
Last active July 29, 2016 04:08
React Kanban

React Kanban

A digital Kanban board made with React

kanban_guide_print_kpo_bleed_board2-1024x517

"The Kanban technique emerged in the late 1940s as Toyota’s reimagined approach to manufacturing and engineering. ... The system’s highly visual nature allowed teams to communicate more easily on what work needed to be done and when. It also standardized cues and refined processes, which helped to reduce waste and maximize value." - via LeanKit.com

Introduction

Build a Digital Kanban board using:

  • React for building the front-end User-Interface (UI)
@sgnl
sgnl / README.md
Created July 3, 2016 01:53
Rules for Test Driven Development (Clean Code summary)

The Three Laws of TDD

  1. You may not write production code until you have written a failing test.
  2. You may not write more of a test than is sufficient to fail.
  3. You may not write more production code than is sufficient to pass the current failing test.

F.I.R.S.T principle

Fast Tests should be fast. They should run quickly. When tests run slow, you won't want to run them frequently. If you don't run them frequently, you won't find problems early enough to fix them easily. You won't feel as free to clean up the code. Eventually the code will begin to rot.