Skip to content

Instantly share code, notes, and snippets.

View jaywon's full-sized avatar

Jason Sewell jaywon

View GitHub Profile
@theRemix
theRemix / 1.easy.js
Last active August 29, 2015 14:24
Multiple Callbacks without any Promises
var asyncsDone = [false,false];
function fun1 (arg1, callback) {
// do some async function using arg1
setTimeout(function () {
arg1 += 10;
// async function done
callback(null, arg1);
}, 1000);
}
@sgnl
sgnl / sublimelinter.develeague.md
Last active May 4, 2016 07:33
Adding the SublimeLinter and JSHint packages to your sublime text 3.
  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

  • Open up Package Control in your sublime text. (cmd+shift+P)
    1. Type PC Install to make use of FuzzySearch to bring up Package Control: Install Package
  1. Hit the enter key
@kellishouts
kellishouts / airship-users-2016-08-27.md
Last active September 29, 2016 20:44
Airship Users - Aug 27, 2016

Updated Aug 27, 2016

Install Airship CLI

Installing the cli tools on a Mac or Linux

You only need to do this for your system when you first start developing Airship projects, or whenever a new version of the cli becomes available. Download the latest version of the cli at:

[install.airshipcms.io[(http://install.airshipcms.io)

Installing the cli tools on a PC

@singpolyma
singpolyma / epub2html.rb
Created December 6, 2010 21:37
Convert ePub files to XHTML
#!/usr/bin/ruby
# Usage ./epub2html.rb thing.epub thing.html
#
# ePub files are just XHTML with a ton of (often useless) stuff layered on top
# This script extracts the XHTML content and sticks it together
# It tries to preserve common metadata
# It tries to preserve images
# It converts Google Books' crap .gtxt_heading to <h1>
@martinklepsch
martinklepsch / README.md
Last active February 28, 2022 04:34
A very minimal Emacs configuration to get started with Emacs & Evil-mode

A Starting Point for using Emacs & Evil-mode

(I wrote a bit about why Emacs and Vim on my blog and thought it might be nice to give some starting point for people that want to try it.)

If you just want to play around with Emacs & Evil mode do the following:

  1. mkdir ~/.emacs.d/
  2. copy init.el into ~/.emacs.d/
  3. Download Emacs from http://emacsformacosx.com
@tylernchls
tylernchls / Webgoat.md
Last active December 17, 2022 21:52
Web Goat Solutions

HTTP Basics

Excerise #2
  • Solution: Inpect Post request in dev tools and you will see magic number at bottom with the post data.

SQL Lesson

String injection
  • Goal: Return all users from the user table in the db via string injection
  • Enter Smith will give you single record
  • Solution: Fart' OR '1'='1
  • The above will return all users in the db even though their is no user named Fart. This is because every record will return with a true value hence the OR statement('1'='1 or true), therefore return the whole users table.
@cb372
cb372 / jargon.md
Last active May 8, 2023 16:03
Category theory jargon cheat sheet

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.

@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@chantastic
chantastic / on-jsx.markdown
Last active March 20, 2024 01:03
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't