Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 03 02:40
    thestriver starred codebar/tutorials
  • Nov 23 10:52
    alexanderkhivrych synchronize #484
  • Nov 21 17:15
    alexanderkhivrych synchronize #484
  • Nov 21 14:56
    alexanderkhivrych synchronize #484
  • Nov 20 22:41
    alexanderkhivrych opened #484
  • Nov 08 15:59

    KimberleyCook on gh-pages

    feat(html, lesson2): added chil… Merge pull request #483 from al… (compare)

  • Nov 08 15:59
    KimberleyCook closed #483
  • Nov 06 21:49
    alexanderkhivrych starred codebar/tutorials
  • Nov 06 21:46
    alexanderkhivrych opened #483
  • Oct 05 22:42

    dependabot[bot] on bundler

    (compare)

  • Oct 05 22:42
    dependabot[bot] closed #475
  • Oct 05 22:42
    dependabot[bot] labeled #482
  • Oct 05 22:42

    dependabot[bot] on bundler

    Bump addressable from 2.5.2 to … (compare)

  • Oct 05 22:42
    dependabot[bot] opened #482
  • Aug 22 21:38
    Diacachimba26 starred codebar/tutorials
  • Aug 08 16:33
    yednapg starred codebar/tutorials
  • Jul 24 00:34

    richardwestenra on gh-pages

    Corrected minor spelling and gr… Merge pull request #481 from pe… (compare)

  • Jul 24 00:34
    richardwestenra closed #481
  • Jul 19 14:55
    peterhauke opened #481
  • Jul 12 12:08
    Suzannelove starred codebar/tutorials
Kriszta Matyi
@matyikriszta
@assembly21 this is a good overview of the different features of SCSS using the CSS like syntax
or this code school tutorial is really good, I remember doing it back in the day
the fist part is free, after that you have to pay for it but it's worth looking at the fist video at least
Baris Balic
@barisbalic
@assembly21 it's terribly named, but 'scss' and 'sass' are both Sass. Searching for Sass on it's own should bring up results but you will need to filter. The Sass-lang website shows all examples in scss by default: http://sass-lang.com/guide
Carolina Sawney
@assembly21
thanks! @matyikriszta, @davegurnell , @barisbalic
Nicky Chorley
@ndchorley
hopefully everyone's aware that there's a Tube strike starting tomorrow: https://tfl.gov.uk/modes/tube/tube-strike, sigh
Kriszta Matyi
@matyikriszta
@ndchorley yes, we have sent out a tweet about it yesterday, will repeat it tomorrow
thanks for the heads up :)
Nicky Chorley
@ndchorley
we're really in Whitechapel tonight?
Kriszta Matyi
@matyikriszta
@ndchorley yes, we are
sorry if that' a bit inconvenient for you
it's a bit further out than our usual locations
Nicky Chorley
@ndchorley
no, it's good. It's relatively easy to get home from there :D. I was a bit confused as I looked at ClauseMatch's website and that's not where their office is!
thanks :D
Carolina Sawney
@assembly21

Hi: I'm practising exercises from Head First Javascript Programming (p.101).

I write the code in the book in the console and it gives me an error: points is not defined. It's not necessary to define a variable points for the parameters, right? Thanks in advance.

var avatar = "generic";
var skill = 1.0;
var pointsPerLevel = 1000;
var userPoints = 2008;

function getAvatar(points){
var level = points / pointsPerLevel;
if (level == 1) {
return "Teddy bear";
} else if (level == 1) {
return "Cat";
} else if (level >= 2) {
return "Gorilla";
}
};
function updatePoints(bonus, newPoints) {
var i = 0;
while(i<points){
newPoints = newPoints + skill * bonus;
i = i + 1;
}
return newPoints + userPoints;
}
userPoints = updatePoints(2,100);
avatar = getAvatar(2112);

Ali
@Najaf
It looks the problem is in your usage later in updatePoints
Where you're doing while (i < points)
points doesn't appear to be defined in the scope of updatePoints I mean.
Carolina Sawney
@assembly21
the book has 6 tech reviewers...
Ali
@Najaf
:P Who wants to spend their whole day reading code? Sounds way too much like work.
Carolina Sawney
@assembly21

Hi everyone,
I'm practising Javascript with exercises from two books. They explain not to use global variables but then in the examples, they use them very often. So I'd like to rewrite this example from Javascript Head First, so that it's all done with locals. But my version is not completely right...So I'd appreciate your comments. Thanks in advance.

The code from the book:

var avatar = "generic";
var skill = 1.0;
var pointsPerLevel = 1000;
var userPoints = 2008;

function getAvatar(points){
var level = points / pointsPerLevel;
if (level == 1) {
return "Teddy bear";
} else if (level == 1) {
return "Cat";
} else if (level >= 2) {
return "Gorilla";
}
};
function updatePoints(bonus, newPoints) {
var i = 0;
while(i<bonus){
newPoints = newPoints + skill * bonus;
i = i + 1;
}
return newPoints + userPoints;
}
userPoints = updatePoints(2,100);
avatar = getAvatar(2112);

My version with locals - but gives me undefined...

function getAvatar(points){
var pointsPerLevel = 1000;
var level = points / pointsPerLevel;
if (level == 1) {
return "Teddy bear";
} else if (level == 1) {
return "Cat";
} else if (level >= 2) {
return "Gorilla";
}
};
function updatePoints(bonus, newPoints) {
var i = 0;
var skill = 1.0;
var userPoints = 2008;
while(i<bonus){
newPoints = newPoints + skill * bonus;
i = i + 1;
}
return newPoints + userPoints;
}

function init(){
userPoints = updatePoints(2,100);
var avatar = getAvatar(2112);}

Denise Yu
@deniseyu
@assembly21 could you please wrap code snippets in code tags? click the list icon at the bottom right of the textbox. it will make your code much easier to read :)
an aside, does anyone want to help QA test some new codebar app features? send me a private message
@assembly21 i think the book code is wrong. there are two conditions where level == 1. you should always use === not ==
Juyoung
@juyoungbang
@assembly21 I am just wondering why there is the same condition as 'level == 1' twice....
Juyoung
@juyoungbang

in the book,
there is the default value of 'avatar' so it seems to work well even though it is weird there is the same condition twice,
but in your version,
the return value of getAvatar() hasn’t the default one.
So if level is not equal to 1,2 or greater than 2, getAvatar() will return undefined…

you could code like following...
getAvatar(){
if(){..}
else if() {..}
return ‘generic’;
}

That is just my guess, so it might be wrong...

Kai Chan Vong
@kaichanvong
@deniseyu or another organisers for codebar. Do I need to make sure I'm on the list (of coaches). It's for my speaking slot. Wondering if I can just turn up?
Denise Yu
@deniseyu
@kaichanvong your lightning talk is next week (Thoughtworks)! tomorrow is Kate's turn. on the night that you are scheduled, if you don't manage to RSVP in time for a coach slot just email us. lightning talk speakers get priority, whether you're a coach or student...another incentive to sign up for one! :)
Kai Chan Vong
@kaichanvong
Didn't get in for this evening's event. Booo.
Denise Yu
@deniseyu
does anyone have experience migrating image assets from a heroku platform service (in this case, Cloudinary) over to AWS?
Baris Balic
@barisbalic
@deniseyu I'm not aware of any migration tools, I believe it's a case of DIY
Denise Yu
@deniseyu
@barisbalic i had suspected as much... :-/ Cloudinary wants us to pay $50 a month for optimized image hosting, but last night a few coaches suggested just getting an AWS bucket would be much cheaper. if anyone has some time to help out w this, please let me know. i've not had to do this before and don't want to accidentally delete all of our assets lol
Baris Balic
@barisbalic
You can have both in place, and not delete cloudinary resources until you're happy/sure it's all in place
Carolina Sawney
@assembly21

Hi: I'd like to know how to create a .gitignore file from the command line to exclude .idea related files. I don't know what do I need to exclude.
Or if this is just a txt.file.

I have this:

'code'
Carolinas-MBP:first_git_project carolina$ git add .
Carolinas-MBP:first_git_project carolina$ git commit -m "Initial commit"
[master (root-commit) 19c3842] Initial commit
9 files changed, 394 insertions(+)
create mode 100644 .idea/.name
create mode 100644 .idea/compiler.xml
create mode 100644 .idea/copyright/profiles_settings.xml
create mode 100644 .idea/first_git_project.iml
create mode 100644 .idea/misc.xml
create mode 100644 .idea/modules.xml
create mode 100644 .idea/vcs.xml
create mode 100644 .idea/workspace.xml
create mode 100644 first_file.html
Carolinas-MBP:first_git_project carolina$ .idea/
-bash: .idea/: is a directory
Carolinas-MBP:first_git_project carolina$
'code'

I know that inside the .gitignore file I can add this:

.idea/workspace.xml
.idea/modules.xml

Thanks!

Denise Yu
@deniseyu
in .gitignore in the root of the project directory (create one if you haven't yet), just put .idea/in it
Carolina Sawney
@assembly21
but idea has .idea/first_git_project.html that's the one I'm tracking...and how to I create the file, what kind of file is it. What should I write on the command line I mean.
Denise Yu
@deniseyu
then exclude by extension, like .idea/*.xml, etc
Baris Balic
@barisbalic
@assembly21 @deniseyu from the command line you can use echo in conjunction with >> to append to a file
@assembly21 @deniseyu for example echo .idea >> .gitignore will add ".idea" to the ignore
If you use special characters you may need to put " around the string
echo ".idea" >> .gitignore
Carolina Sawney
@assembly21
that's the line of magic I needed, cheers.
Baris Balic
@barisbalic
@assembly21 no problem!
@assembly21 be cautious of dropping > because that will overwrite the file rather than append to it
Carolina Sawney
@assembly21

Shall I ignore the .gitignore "untracked files" and the "changes not staged for commit"? Here's the console.

"code"
Carolinas-MBP:first_git_project carolina$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified:   .idea/misc.xml
modified:   .idea/workspace.xml

Untracked files:
(use "git add <file>..." to include in what will be committed)

.gitignore

no changes added to commit (use "git add" and/or "git commit -a")
Carolinas-MBP:first_git_project carolina$

"code"

Thanks.

Baris Balic
@barisbalic
Sorry I cannot understand what that means
You wanted to ignore idea?
you would need .idea/ in your .gitignore