Skip to content

Instantly share code, notes, and snippets.

View jsstrn's full-sized avatar
🕺
Your best friend

Jesstern Rays jsstrn

🕺
Your best friend
  • Singapore
  • 09:55 (UTC +08:00)
View GitHub Profile
@jsstrn
jsstrn / simple_html_template.html
Last active December 21, 2015 06:59
This is a very basic HTML template document. Copy the code snippet into your own HTML document and start creating your very first web page.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf 8">
<title>My First Web Page</title>
</head>
<body>
<h2>My First Web Page</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
@jsstrn
jsstrn / geometry.py
Created August 25, 2014 11:11
Drawing geometric shapes in Python using Turtle
import turtle
def drawSquare(my_turtle):
my_turtle.color("red")
for i in range(4):
my_turtle.forward(100)
my_turtle.right(90)
def drawSomethingCool(my_turtle):
my_turtle.color("yellow")
@jsstrn
jsstrn / FirstFactorial.cpp
Last active September 14, 2023 18:56
These are my solutions to the Coderbyte challenges written in C++
#include <iostream>
using namespace std;
int FirstFactorial(int num) {
// set the limit to the number provided
int limit = num;
for (int i = 1; i < limit; ++i) {
num = num * i;
}
return num;
@jsstrn
jsstrn / FirstReverse.py
Last active August 29, 2015 14:05
These are my solutions to the Coderbyte challenges written in Python
def FirstReverse(str):
# create a new empty string
rstr = ""
# loop through characters in str
for i in str:
# add characters to the front of rstr
rstr = i + rstr
return rstr
print FirstReverse(raw_input("Enter a word: "))
@jsstrn
jsstrn / FizzBuzz.js
Last active November 7, 2015 05:54
A FizzBuzz solution written in JavaScript
/**
* Write a program that prints the numbers from 1 to 100.
* But for multiples of three print "Fizz" instead of the number
* and for the multiples of five print "Buzz".
* For numbers which are multiples of both three and five print "FizzBuzz".
* */
var size = 100
method1(size)
@jsstrn
jsstrn / countries.json
Created December 17, 2015 12:20 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},

Create a new model for comments in app/models/comments.rb

class Comments < ActiveRecord::Base
  belongs_to :post
end

Create a migration file for comments:

@jsstrn
jsstrn / Week01Day01.md
Last active February 16, 2016 01:57
Notes for WDI SG 2

$ ping google.com

Copy the IP address and paste it into a browser.

$ traceroute google.com

$ man traceroute

breakdown of a URL - scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]

@jsstrn
jsstrn / constructor.js
Last active February 19, 2016 04:30
JavaScript Design Patterns
function Ape (name, species, approvedListOfFoods) {
this.name = name
this.species = species
this.approvedListOfFoods = approvedListOfFoods
this.introduce = function () {
console.log('Hello! My name is ' + this.name + '. I am a ' + this.species + '. I like ' + this.approvedListOfFoods)
}
this.eat = function (food) {
@jsstrn
jsstrn / test.md
Created February 23, 2016 03:18
Test
var x = 1
var x = 1