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?
  • Hawaii
View GitHub Profile
@sgnl
sgnl / functional-array-methods.js
Created June 23, 2016 02:59
What Javascript's Iterator/Functional Array methods might look like under the hood (example as an intro to these methods)
Array.prototype.reduce = function(callback, initialValue) {
var prev = initialValue;
// did not give initialValue? set it to ZERO
if (!initialValue) {
prev = 0;
}
for (var i = 0; i < this.length; i++) {
prev = callback(prev, this[i], i, this);
@sgnl
sgnl / pig.js
Created June 22, 2016 20:26
Pig Latin Example
function pigLatinify(sentance) {
return sentance
.split(' ')
.reduce(parseWord, '')
.trim();
}
function parseWord(prev, word) {
// find closest vowel
var closestVowelPosition = findClosestVowel(word, ['a', 'e', 'i', 'o', 'u']);
@sgnl
sgnl / notes.md
Last active September 29, 2016 19:14
the simple magic of professional networking

these are my notes from the talk @ MIC on 5/23/2016

The Simple Magic of Professional Networking

Presenter: Representative Lauren Cheape Matsumoto

Making Connections:

  • do it before you need it
  • build relationships first
  • say the person's name back to them a few times (helps you remember but also starts to build a positive connection)
  • never dismiss someone as unimportant
@sgnl
sgnl / README.md
Last active March 29, 2016 00:58
Pig Latin Specs

New Hire at CyberWeezardInstitoot

Welcome to the Team... actually, hold on.

Before you can join our team you must pass our test. More specifically, you must write tests. I've heard that you built a pig latin translator app. I've also heard you're familiar with Mocha and Chai. The former will get you nowhere with us.

We want you to write your test using the [Tape][1] library. [Tape][1] is a test runner and it also provides you with an assertion language. We like it here because it's assertion language is quite simple.

@sgnl
sgnl / README.md
Last active November 9, 2022 21:48
Setting up SASS (SCSS) files with gulp, gulp-sass, and Browser Sync!

Create a new temp project

  1. $ mkdir sass_gulp_workshop
  2. cd into the new directory
  3. Initialize NPM: $ npm init --yes
  4. Install gulp and gulp-sass packages: $ npm install -D gulp gulp-sass browser-sync
  5. Update package.json's scripts section with this key-value pair: "scripts": { "dev": "gulp" }
  6. Recreate this file structure in this directory:
  • public (directory)
    • css (directory)
    • index.html (file)
@sgnl
sgnl / cli.md
Last active May 5, 2025 17:33
Setting up Mocha and Chai CLI: Done Browser: WORK IN PROGRESS

Always 💯

  • use git status, ideally between each and every git command (especially when starting out).
  • Have the documentation up. Link to: MOCHA DOCS & CHAI DOCS API
  • Ask for help after 10 mins.

Set up your project to use Git and NPM

  1. Create or have a project ready then move into that project directory.

  2. Use Git

  • issue the command: $ git init to initialize git
@sgnl
sgnl / index.js
Last active March 18, 2016 05:12
Palindromic Number Generator - Answer #1
function palindromic(input, steps) {
if (!steps) steps = 0;
if (!isPalindromeNumber(input)) {
return palindromic(buildNewInput(input), ++steps);
}
return { value: input
, steps: steps
}
function Animal (breed, size, color) {
this.breed = breed;
this.size = size;
this.color = color;
}
Animal.prototype.walk = function() {
console.log(this.name + ' is walking!');
};
@sgnl
sgnl / alice.txt
Created February 27, 2016 21:54
Only punctuations from "Alice in Wonderland" from https://www.gutenberg.org/ . generated by https://www.npmjs.com/package/punc
,:,,',''?'(,),-,.;,'!!!'(,,);-,,,,-,,,,-.,.-,,.,,.,,;,-;.;'',:,.'!',',!'!,',!'(.),,.!''?'.'.:,--'(,,,,,)'--,'--'?'(,,.).'!'!,--'(,,')'--,.,',?'(--'!?)''!,':.',,.,.''-,!'(.)''-.!!,',,',.,?',,,'??','?',,','.,,,',,:?',!!,.,:,;,,.:,,,','!',:,,.,;,,,.-,;,';,!,,.,,,:,!,-:.,,;',','.,!,.',,---,.,,,:,(',',),''.','.',',',''""';,,:,-;,;,',',.,',',,(,,-,,-,,,,).'!';'.':,.,,:;',,',',.?',.,,;,!,,,:,,;,.','!',;'!',(),;,.'',','!,'!':,,''.',',',',;,;','!',,'??',,:,,---,.,.'!'(,);''!-,!'(,,).',,,?''!:;--,',''!:'.'.',';'','!!',.,,(').,'!':,.!,,;:.',',','(),'!,!',,,.,.,,:,,'!,!!''!';,,,,,',--',,.,,,:',!-!.'?:?.',,?,'!',.''',',',';'',,,!!,',',--,!'.:,,--!!,':'.,,--,','!!'"--"',,,:--',!',,!''',',,',,,!!,';','!'",!""?,,,':,''"--,!',,'!!','.'?'.'.',,,,:,,.'!',,;'!':,!,,',',',!',!',,!.,','.(,,,,,.),.''!',,.',,!,!,-.',:,,.',,','?---,:,'.':',?,!'(:,','--------!'),,.'',';'',.'(,,.):'?'-.,.',!','.''.''!',,.'?'',,':''.:'.,',,,',----'--,!',,.'''.''!',.'!:,,!'!'''!',.'------?',:'!-,,,!',',--'--,,','!--!','''!',.,'!,','!',:(,),,',','.',:,,.,
@sgnl
sgnl / README.md
Last active February 12, 2016 20:55
Finding Inspiration

Finding Inspiration

Project ideas are tough. Below I will outline resources for inspiration via links, articles, and anecdotes from myself and other here at Dev League.

Personal Inspiration

The Truth is out there. - Agent Fox Mulder, FBI

Ideas can come from within. Look into your everyday life, is something missing that would make it better?