Skip to content

Instantly share code, notes, and snippets.

@jasterix
jasterix / main.py
Created November 22, 2018 18:41
StridentPointlessPriorities created by jasterix - https://repl.it/@jasterix/StridentPointlessPriorities
# Hello World program in Python
import random
secret_number = random.randint(0, 100)
guess = -1
counter = 0
while secret_number != guess and counter < 10:
guess = int(input("Enter a number: "))
if 0 <= guess <= 100:
if guess < secret_number:
@jasterix
jasterix / README.md
Created December 7, 2018 21:53 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
class Show < ActiveRecord::Base
def self.highest_rating
Show.maximum(:rating)
end
def self.most_popular_show
self.where("rating=?",self.highest_rating).first
end
@jasterix
jasterix / mysql.database.yml
Created August 12, 2019 00:06 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
module.exports = function (grunt) {
grunt.initConfig({
// jshint: {
// browser: ["public/js/**/*.js"],
// },
jshint: {
client: ["public/js/**/*.js", "!public/js/vendor"],
},
// less: {
// compile: {
@jasterix
jasterix / 30-days-of-css-girls-4-heart-button.markdown
Created June 29, 2020 15:02
30 Days of CSS Girls- 4: Heart Button
@jasterix
jasterix / singlyLinkedList.js
Created August 16, 2020 17:11
Creating and working with Singly Linked Lists
class Node{
constructor(val){
this.val = val;
this.next = null;
}
}
class SinglyLinkedList{
constructor(){
this.head = null;
@jasterix
jasterix / doublyLinkedList.js
Created August 16, 2020 17:12
Creating and working with Doubly Linked Lists
class Node{
constructor(val){
this.val = val;
this.next = null;
this.prev = null;
}
}
class DoublyLinkedList {
@jasterix
jasterix / queue.js
Last active August 18, 2020 12:03
Queue - Implementing a queue using a singly linked list
class Node {
constructor(value){
this.value = value;
this.next = null;
}
}
class Queue {
constructor(){
this.first = null;
@jasterix
jasterix / stack.js
Created August 16, 2020 17:14
Implementing a stack with a singly linked list
class Node {
constructor(value){
this.value = value;
this.next = null;
}
}
class Stack {
constructor(){
this.first = null;