Digging into SASS
I wish I’d of learned this sooner.
🪼
ojovivo
Mike Driver
sheepfilms
dirt enthusiast

JBB: An Artblog!

#extradirty

No title available

if i look back, i am lost
Cosmic Funnies
$LAYYYTER
Alisa U Zemlji Chuda
No title available
Keni

blake kathryn

Andulka
Today's Document

ellievsbear

Product Placement
Stranger Things

seen from United States

seen from Canada

seen from United States

seen from United States
seen from Japan
seen from United States
seen from United States

seen from Canada
seen from United States
seen from United States
seen from United States
seen from Chile

seen from India
seen from France

seen from Peru

seen from Argentina
seen from Venezuela

seen from United States
seen from United States

seen from Netherlands
@dwightdoane
Digging into SASS
I wish I’d of learned this sooner.
I just bought 2 $10 Udemy courses. One on React and one on Backbone.
I haven’t used backbone in a while, so I would like to refresh and learn some more in-depth topics. and I have zero react experience, so I’d like to jump on the bandwagon and see if I fall off.
But for now I gotta finish up the FullStack JS track on teamtreehouse, halfway through the last course.
The trials and tribulations of a wannabe web developer
The job market around here is kinda slim pickings. Especially for a college student who doesn’t have a whole lot of experience, or much of a portfolio. Employers seem to want X number years of experience && || a 4 year bachelors.
I have ~3 years of front end experience, and ~1 year of backbend (node) expereince; and no degree, yet.
I see PHP jobs and Front end jobs. But I don’t know PHP and I’m not a designer.
So I figured I’d learn a bit of php, and maybe jump into Wordpress as well.
But now I’m changing my mind again. I’m leaning more towards diving into JavaScript more. I kinda want to learn more functional programming, and then get up to speed with ES6. Rather than waste my time trying to learn PHP.
So I think I’ll shift my focus to front end frameworks. I have some experience with vanilla javascript, node.js, angular, jquery, and so on. But I need to buckle down and learn CSS a whole hell of a lot better. I need to learn how to structure my code nicer too. I think I’ll be better off staying on the front end for now. At least until node takes off a little more.
I start school again in 2 weeks, so I need to get started. Now.
/rant
So today I embark on learning PHP. I’m reading Programming PHP to get myself up to speed.
I’ve been dabbling in Node.js for about a year now, and haven’t touched PHP in over 2 years.
I keep seeing PHP and WordPress dev jobs around here, but not any Node jobs. Plus it seems most FrontEnd gigs require more designing... which is a bummer since I’m not a designer.
So here goes nothing.
TDD with QUnit, Backbone, Browserify & Gulp
I'm getting started with TDD and this is just a quick demo to show how I got set up testing Backbone with QUnit
First we gotta install dependencies
npm install qunitjs browserify gulp vinyl-source-stream gulp-rename --save-dev
npm install jquery underscore backbone
We need a folder for our tests, and inside that folder we need an index.html file where QUnit will run the tests
/app/tests/index.html
index.html body tag should look like:
<h1 id="qunit-header">QUnit Test Suite</h1> <h2 id="qunit-banner"></h2> <div id="qunit-testrunner-toolbar"></div> <h2 id="qunit-userAgent"></h2> <ol id="qunit-tests">test markup, hidden.</ol> <script src="./js/tests.js"></script>
and inside tests we have another folder for our js
/app/tests/js/testsource.js
which will hold our testsource.js file, which will look something like this:
window.$ = window.jQuery = require('jquery'); window._ = require('underscore'); window.Backbone = require('backbone'); Qunit = require('qunitjs'); Qunit.module('Food Model'); QUnit.test("food model defaults", 2, function(assert) { var Food = require('path/to/models/foodModel.js'); var food = new Food(); assert.equal(food.get('name'), 'banana', 'default name should be banana'); assert.equal(food.get('quantity'), 4, 'default quanity should be 4'); });
Next we have to set up our gulpfile.js
var gulp = require('gulp'), browserify = require('browserify'), source = require('vinyl-source-stream'), rename = require('gulp-rename'); gulp.task('tests', function() { return browserify('./app/tests/js/testsource.js') .bundle() .pipe(source('tests.js')) .pipe(gulp.dest('./app/tests/js/')); });
open terminal and type
"gulp tests" without quotes
Which will build the tests.js file for our tests' index.html page
Next we open our tests' index.html file and you should see the output for your tests. if any fail (as they should) fix em and rerun the tests
You can even set up gulp to watch for changes to testsource.js and rerun 'tests' automatically and even reload the browser window with livereload
Setting up a raspberry pi to control my 3d printer
Because I can
So i've decided to put the source code for my cop 1000c homework on line.
Its an intro to programming course, but the homework has to be done in C.
I've never really used C before. I think Arduinos use C. but i haven't messed with mine in ages.
I am comfortable with javascript, so for fun i do some or all of the assignment in JS before I do it in C.
Heres the link if you're interested in following along, or copying my homework.
Code School
I plan on quitting my job soon, I absolutely hate retail.
I'm using code school right now to teach myself some new things before I quit though.
I need to learn some git. So here I am. Git Real. Level 5.
Seems intuitive enough.
Stil have a lot to learn.
I plan on putting in my 2 weeks by valentines day.
So that two weeks later I'm out.
22 days to go.
I'm quitting my job.
There. I said it. By the end of the month I will no longer be working at sears. No more retail. No more managers or co-workers. No more 5am alarms. No more 6am commutes. No mall food lunches. I'm done. I'm going to start freelancing full-time. I want to be a web developer. I will be a web developer. I have enough money in reserve to pay all my bills for 6 months. I'm taking the leap.
Thoughts on coding
It's like I don't know how to do something right away.
I know what needs to be done.
Then i take steps to start solving that particular problem.
it may not be the 'correct' way. but it works.
Relaunching my webapp soon
I really like backbone.js I just finished rewriting the bulk of my little meteorjs app I call Olli It's a simple list making app with an emphasis on mobile devices. Right now it's mostly gestures. Tap. Double tap and swipe. Each list item can also contain it's own list. And each item in those lists can have another list. Ad infinitum. I'm using a local storage wrapper for backbone. Now everything stays on the device. No worrying about logging in or account setup and syncing to a database or database management. Before it took up to 7 seconds to load only a few items on a 3G connection. Now it's instantaneous even without internet. Since I'm using appcache. Meteor is great. But my app is too small scale and simple for it. Where as backbone is perfect. All that's left is some final tweaking and testing. I'll probably try to launch it this weekend. Most likely going to set it up on amazon s3 since it's a static single page app. And I can get a year of hosting free. I already have a domain. I'm going to make a couple small videos of it in action first and post them here.
Stumped
I’ve still been practicing JavaScript and have come across a problem that has stumped me. It is just to create a method that accepts an array of names, and returns an array of each name capitalized. In Ruby this would be pretty simple, but JavaScript is a whole other animal. I’m only able to return the first word capitalized. I’m not able to return the other words. Pretty sure my for loop is written correctly. Anyone have an idea leave a comment.
This is my code:
Take the return out of the for loop. otherwise it ends the loop prematurely.
for (var i = 0; i < names.length; i++ ) {
result.push(names[i].charAt(0).toUpperCase() + names[i].substr(1));
}
return result;
should work.
function capMe(names) { var result = []; for(var i = 0; i < names.length; i++) { result.push(names[i].charAt(0).toUpperCase() + names[i].substr(1)); } return result; }
Stumped
I’ve still been practicing JavaScript and have come across a problem that has stumped me. It is just to create a method that accepts an array of names, and returns an array of each name capitalized. In Ruby this would be pretty simple, but JavaScript is a whole other animal. I’m only able to return the first word capitalized. I’m not able to return the other words. Pretty sure my for loop is written correctly. Anyone have an idea leave a comment.
This is my code:
Take the return out of the for loop. otherwise it ends the loop prematurely.
for (var i = 0; i < names.length; i++ ) {
result.push(names[i].charAt(0).toUpperCase() + names[i].substr(1));
}
return result;
should work.
I'm going to rewrite my meteor.js app in backbone, and start completely fresh.
Nothing against meteor, its a great framework, but my app needs to be able to work completely offline. Its just not fast enough when it has to connect to a db
Trying to use my app on the go, using sprint's 3g network, makes it harder than it should be. It takes several seconds for my data to be available.
So I'm going to rewrite it to be offline first, then maybe sync to a database later.
I learned a lot about meteorjs, structuring and building an app and javascript in general, and am hoping i learn even more by rebuilding it in backbonejs.
I really like codewars.com
it really tests my javascript knowledge, and makes me solve problems i wouldn't normally come across.
Then after I solve it I get to see how others have solved it and I gain even more knowledge from seeing their solutions.
Once again making meteor.js my bitch
I guess 0.8.0 changed how they did their login flow with facebook
I hacked together a different way to generate a profile and login with Facebook, since Meteor's built in {{loginButtons}} do not work well when you are using the mobile web app capable meta tag, or 'standalone' mode on mobile
You can read about it here
All I had to do was add
var x = DDP._CurrentInvocation.get(); var token = Accounts._generateStampedLoginToken(); Accounts._insertLoginToken(userData.userId, token); Accounts._setLoginToken(userData.userId, x.connection, Accounts._hashLoginToken(token.token))x.setUserId(userData.userId)
Dont ask me how I figured it out. I just looked at their accounts-base/accounts_server.js source code on github
its 2am and my brain is fried.
fuck it
Im just gonna base64 encode my images and save them to my mongodb collection
fuck turning them into a binary blob, and fuck uploading them to s3
blobs have limited support, and uploading to s3 means having to download them every time the app loads
running a few quick tests on my iPhone 4s iOS 7 loading 3 images from my localhost
1: datauri base64 encoded loads the fastest
2: binary blob
3: s3 hosted image
even on my macbook pro with 16gb ram, base64 wins out
all of them have the same image loaded
base64 encoded images have pretty broad support across browsers/devices
so fuck it
its quick and easy