Skip to content

Instantly share code, notes, and snippets.

@oliverbenns
oliverbenns / script.sh
Created January 20, 2017 10:49
Domain Check Availability (bash script)
# Bash domain checker
# Usage: sh script.sh [domain name]
# If it says "No match for [domain]", it is available.
tlds=("com" "net" "co" "io" "co.uk")
for tld in "${tlds[@]}"
do
whois "$1.$tld" | grep "No match for";
done
@oliverbenns
oliverbenns / pubsub.js
Created December 2, 2015 02:33 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
<snippet>
<content><![CDATA[console.log('$1', $1);]]></content>
<tabTrigger>log</tabTrigger>
<scope>text.html,source.js,source.jsx</scope>
<description>console.log()</description>
</snippet>
@oliverbenns
oliverbenns / lingos.md
Created October 13, 2015 10:57 — forked from ckampfe/lingos.md
Languages

Languages

Early Languages (1960s and earlier)

  • COBOL: Probably the first language that looked "human readable". Invented with "business" in mind, ie, banks, corporations, etc. Still in use at many financial places as their installations are huge and would be expensive to replace/rewrite. COBOL programmers are very hard to find and very expensive.

  • Fortran: Developed at IBM in the 1950s, still incredibly popular today for economics calculations, math, finance, etc. Popular in academia for this reason.

  • C: Massively influential. probably the most famous programming language. Invented at Bell Labs in the 60s. Still in incredibly wide use for such applications as operating systems, microcontrollers, or anything where speed is a necessary. Very fast, but easy to write buggy code. Runs on almost any hardware ever made. It's syntax and idioms live on in Java, JavaScript, C#, C++

Middle-aged languages (1970s & 1980s)

# Grid / Css classes (.col-md-3 etc.) like Bootstrap.
+ Consistent
+ Easy to implement and keep responsive
+ Ensures decoupling of layout and components
- Pumps out a lot of grid classes, many of which may never get used.
- Always need to wrap in a row element (Bootstrap)
- Not very flexible

Grid / Css classes (.col-md-3 etc.) like Bootstrap.

  • Consistent
  • Easy to implement and keep responsive
  • Ensures decoupling of layout and components
  • Pumps out a lot of grid classes, many of which may never get used.
  • Always need to wrap in a row element (Bootstrap)
  • Not very flexible
# Grid / Css classes (.col-md-3 etc.) like Bootstrap.
+ Consistent
+ Easy to implement and keep responsive
+ Ensures decoupling of layout and components
- Pumps out a lot of grid classes, many of which may never get used.
- Always need to wrap in a row element (Bootstrap)
- Not very flexible
import React from 'react';
import { Router, Route } from 'react-router';
import { history } from 'react-router/lib/HashHistory';
// Components
import App from '../app/'
import NotFound from 'not-found'
// Routes
import Zones from './zones'
.button {
margin-left: 10px;
}
.button:first-child {
margin-left: 0;
}
@oliverbenns
oliverbenns / index.jade
Created June 30, 2015 01:41
Simple, Minimal jQuery Accordion
.accordion.js-accordion(data-accordion-id="testAccordion")
.accordion__header
span Lorem ipsum dolor sit amet
i.icon.icon-plus
i.icon.icon-minus
.accordion__body
p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam, beatae. Maxime quisquam labore optio excepturi doloremque aut natus itaque, cum beatae cumque, sit, est fuga autem sed minus iste eaque.