Skip to content

Instantly share code, notes, and snippets.

View szaim's full-sized avatar

Sofia Zaim szaim

View GitHub Profile
@szaim
szaim / portfolio_advice.md
Created November 16, 2016 23:03 — forked from olexpono/portfolio_advice.md
Thinkful Portfolio Q&A, Tips & Tricks

Portfolio Advice

These are the take-aways from my Q&A sessions working with students on their portfolios at Thinkful. Hopefully these guidelines will make building a successful portfolio site straightforward.

Recommended contents

Keep it simple! Unless you have a blog, or some other major section to your site, it's likely that you don't even need a navigation. In practice, making a "cool reveal" or an awesome unique style is much better than packing in more pages and more projects. Here are the critical sections.

@szaim
szaim / W10D2.js
Created September 28, 2016 14:35 — forked from Rosuav/SearchTree.js
//Utility function to display a binary tree to the console
//More helpful than console.log(tree) due to circular parent refs
//Usage: print_tree(some_tree)
function print_tree(tree, depth) {
if (!depth) {
console.log("" + tree.key);
depth = 0;
}
depth += 1;
if (tree.left) {
@szaim
szaim / W10D1.js
Created September 27, 2016 00:21 — forked from Rosuav/W10D1.js
//NOTE: These functions are NOT reliable if there are astral characters
//in the input! Use with UCS-2 strings only.
//Python implementations of the same algorithms for comparison:
// https://gist.github.com/Rosuav/d02bf71f8bb5354327ee8a8e5fb54e3f
//Write an algorithm to check whether any permutation of a string is a
//palindrome (a string which reads the same forwards and backwards).
//Note that this does not use the HashMap class due to a lack of useful
//features such as iteration. The core algorithm would work the same way
@szaim
szaim / solution for W9D4.js
Created September 22, 2016 21:54 — forked from mrmojica/solution for W9D4.js
Array - Data Structure / Algorithim
// Imagine you have an array of numbers.
// Write an algorithm to remove
// all numbers less than five from the array.
function removeLessFive(array) {
for(var i = 0; i < array.length; i++) {
if (array[i] < 5 ) {
//Iterative versions of https://gist.github.com/Rosuav/5736378d02c6cd459470582ce301b4b4
//Exercise 1: Take an integer as input, and return a boolean indicating whether
//the value is even or odd.
//Editorial comment: This isn't even iterative, just fomulaic. Exercise 4 could
//be done similarly. Avoiding iteration AND recursion generally gives the best
//performance, when it's possible (but usually it won't be).
function is_even(int) {
return (int % 2) == 0;
}
//Exercise 1: Take an integer as input, and return a boolean indicating whether
//the value is even or odd.
function is_even(int) {
if (int < 0) return is_even(-int);
if (int < 2) return Boolean(int | 0);
return is_even(int - 2);
}
//Exercise 2: Take an array as input which contains an unknown set of numbers,
//and output an array which doubles the values of each item in that array. Test
@szaim
szaim / webpack.config.js
Created August 29, 2016 20:29 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@szaim
szaim / client.html
Created August 28, 2016 22:50 — forked from diorahman/client.html
Ajax, call jQuery POST to node.js expressjs
<html>
<head>
<title>jsonp test</title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(function(){
$('#select_link').click(function(e){
e.preventDefault();
console.log('select_link clicked');
@szaim
szaim / todolist.jsx
Created August 26, 2016 14:18 — forked from marekdano/todolist.jsx
Simple Todo list app using React and ES6 with functions delete a todo and/or mark a todo as done
import React from 'react';
/*
Todo app structure
TodoApp
- TodoHeader
- TodoList
- TodoListItem #1
- TodoListItem #2
@szaim
szaim / todo.jsx
Created August 24, 2016 04:09 — forked from caike/todo.jsx
Simple Todo app demo using React + ES6
var React = require("react");
var allItems = []
allItems.push("Buy ingredients for Crock Pot");
allItems.push("Pick up chair at IKEA");
allItems.push("Go see mom");
class TodoList extends React.Component {
constructor(props){
super(props);