This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule TunezWeb.Router do | |
| use TunezWeb, :router | |
| use AshAuthentication.Phoenix.Router | |
| import AshAuthentication.Plug.Helpers | |
| pipeline :graphql do | |
| plug :load_from_bearer | |
| plug :set_actor, :user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Our .tmux.conf file | |
| # Setting the prefix from C-b to C-a | |
| set -g prefix C-a | |
| # Free the original Ctrl-b prefix keybinding | |
| unbind C-b | |
| #setting the delay between prefix and command | |
| set -sg escape-time 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set1 = [[1,2],[5,7],[9,12]] | |
| set2 = [[3,4],[5,6],[13,17]] | |
| puts set1.inspect | |
| puts set2.inspect | |
| puts "combind the two set" | |
| set3 = set1 + set2 | |
| puts set3.inspect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'set' | |
| number = gets | |
| number = number.to_i | |
| max = Math.sqrt(number).to_i | |
| set = Set.new | |
| n_perf = 0 | |
| for i in 0..max |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| str_parse = gets.chomp | |
| s_char = gets.chomp | |
| f_char = gets.chomp | |
| alpha = "abcdefghijklmnopqrstuvwxyz".chars | |
| iter = alpha.find_index(s_char) | |
| while iter >= 0 | |
| substr_arg1 = str_parse.chars.find_index(alpha[iter]) | |
| if (substr_arg1.nil?) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mongoose = require('mongoose'), | |
| Admin = require('./models/admin'); | |
| var connStr = 'mongodb://localhost:27017/rift'; | |
| mongoose.connect(connStr, function(err) { | |
| if (err) throw err; | |
| console.log('Successfully connected to Mongo'); | |
| }); | |
| Admin.findOne({ email:'[email protected]' }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mongoose = require('mongoose'), | |
| Schema = mongoose.Schema; | |
| var AdminSchema = new Schema({ | |
| name: { type: String, required: true}, | |
| email: { type: String, required: true, index: { unique: true } }, | |
| password: { type: String, required: true } | |
| }); | |
| // CRUD operations might be built in not sure... do research! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var a = 1, | |
| b = 2, | |
| temp = 0, | |
| total = 2; | |
| while (total < 4000001) { | |
| temp = a + b; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var total = 0; | |
| for (var i = 1; i < 1001; i++ ) { | |
| if (i%3 === 0 || i%5 === 0) { | |
| total += i; | |
| } | |
| } | |
| console.log(total); |