Skip to content

Instantly share code, notes, and snippets.

View noslouch's full-sized avatar

Brian Whitton noslouch

View GitHub Profile
@noslouch
noslouch / dabblet.css
Created January 26, 2013 19:52
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.banner {
position: relative;
}
.banner .title {
color: #333;
@noslouch
noslouch / privateVariables.js
Last active December 18, 2015 01:39
Private Prototype Variables in Javascript
function makePrivate(){
var privateVariable = 0
return function(){
return privateVariable++
}
}
function Person(name){
this.name = name
console.log(Person.prototype.counter())
@noslouch
noslouch / site-parser.py
Last active July 25, 2019 16:22
extracting html from a buncha files using beautiful soup and csv.writer
#!/usr/local/bin/python
import csv
from bs4 import BeautifulSoup as bs
import os
accepted = ('html', 'php', 'htm')
header = ('path', 'title', 'content', 'images')
pages = []

Keybase proof

I hereby claim:

  • I am noslouch on github.
  • I am noslouch (https://keybase.io/noslouch) on keybase.
  • I have a public key whose fingerprint is EF7C E64C 6555 05FC 8525 BDF8 75CB 2BA4 49B6 42BA

To claim this, I am signing this object:

@noslouch
noslouch / components.inner-component.js
Last active August 29, 2015 14:27
dupe component IDs
import Ember from 'ember';
const get = Ember.get;
export default Ember.Component.extend({
tagName: 'input',
type: 'radio',
attributeBindings: [
'checked',
'disabled',
'name',
@noslouch
noslouch / components.radio-button.js
Last active August 29, 2015 14:27
overlapping component indices
import Ember from 'ember';
const { computed, get } = Ember;
export default Ember.Component.extend({
tagName: 'input',
type: 'radio',
name: 'pledge--amount',
attributeBindings: [
'type',
@noslouch
noslouch / components.my-component.js
Last active April 6, 2016 19:01
isStream Property
import Ember from 'ember';
export default Ember.Component.extend({
isStream: true
});
@noslouch
noslouch / controllers.application.js
Created June 21, 2016 03:50
complex computed props
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
someVal: 'foo',
oneWayComputed: Ember.computed.oneWay('someVal'),
complexComputed: Ember.computed('someVal', {
get() {
return this.get('someVal');
},
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@noslouch
noslouch / components.my-component.js
Last active January 30, 2017 20:36
removing action in dom
import Ember from 'ember';
export default Ember.Component.extend({
});