Skip to content

Instantly share code, notes, and snippets.

View chug2k's full-sized avatar

Charles Lee chug2k

  • San Francisco, CA
View GitHub Profile
@chug2k
chug2k / chalk-util.js
Created April 12, 2020 15:05
Khoa's awesome chalk addon
- OPTIONAL: Well, it's pretty cool and handy ...not. At the time I used this lib for the first time, I felt like I had to type too many characters just to log a string 😄 , so I created a couple of methods that will make it a lot shorter. E.g:
```js
console.log(chalk.red.bold("Hello world!"));
c.red("Hello world!"); // same output as above
```
- OPTIONAL: Here is the code if you want to use it, you can also customize it to suit your needs. Create a file `modules/chalk.js` with the content of following code:
@chug2k
chug2k / README.md
Last active October 2, 2019 03:03
CoderSchool Homework README.md template

CoderSchool FTW - * Name of Your Project Here *

Created with love by: Your Name Here

View online at: Your URL here

One or two sentence summary of your project.

Video Walkthrough

@chug2k
chug2k / gifted-starter.js
Last active October 13, 2018 11:14
GiftedMessenger Starter
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { GiftedChat } from "react-native-gifted-chat";
export default class App extends React.Component {
constructor(props) {
super(props);
let firstMsg = {
_id: 1,
text: "Hello CoderSchool Fan!",
//: Playground - noun: a place where people can play
import UIKit
let CHARACTER_LIMIT = 7
let text = "a b c d e f g h i j k"
class TweetComponent: CustomStringConvertible {
var content: String
let index: Int
@chug2k
chug2k / lemonade_segue.md
Created February 25, 2017 19:04
Initializing a View Controller
  if let destinationViewController = segue.destination as? AddGuestsViewController {
     destinationViewController.event = event
     destinationViewController.isOwner = isOwner
     destinationViewController.limit = limit
  }

This is taken from GuestsViewController.swift. I arrived at this code from the AddGuestsViewController, because I wasn't sure who was setting the value of the event: Event! member of that controller.

I don't think this code is really bad, but a few quick notes:

@chug2k
chug2k / instagram_trending.md
Created November 28, 2015 06:01
Trending Instagram Data
@chug2k
chug2k / index.html.erb
Last active October 27, 2015 21:20
Blog Example
<p id="notice"><%= notice %></p>
<div class="blog-header">
<div class="container">
<h1 class="blog-title">Sang's Blog</h1>
<p class="lead blog-description">The prework assignment for CoderSchool's ruby class!</p>
</div>
</div>
<div class="container">
@chug2k
chug2k / app.js
Created May 28, 2015 07:01
ClickCounterView
$(function () {
var ClickCounterView = Thorax.View.extend({
template: Handlebars.compile("<button class=\"btn\">Click Me!</button><h1>I've been pressed {{times}} times</h1>"),
initialize: function() {
this.times = 0;
},
events: {
'click button': "onButtonClick"
@chug2k
chug2k / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// Simplest possible TableView.
import Foundation
class SimpleTableViewController: UITableViewController {
let data = ["foo", "bar", "baz"]
let CellIdentifier = "CellIdentifier"
override func viewDidLoad() {
self.tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier:CellIdentifier)