This file contains 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
[ | |
{ | |
chapter_number: '1', | |
first_chhand_name: 'ਦੋਹਰਾ', | |
first_verse_number: '1' | |
}, | |
{ | |
chapter_number: '2', | |
first_chhand_name: 'ਚੌਪਈ', | |
first_verse_number: '7' |
This file contains 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
const isUnitInStage = (context) => { | |
const currentStageNum = context?.schedule?.current_stage; | |
return context.target.stage === 'EVERY' || context.target.stage === currentStageNum; | |
} | |
const isUnitInDay = (context) => { | |
return context.target.day_in_stage === 'EVERY' || context.schedule.day_in_stage === context.target.day_in_stage; | |
} | |
const sendNotification = (context) => { |
This file contains 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
const graphql = require('graphql') | |
const _ = require('lodash') | |
// I don't really know what this does tho | |
const { | |
GraphQLObjectType, | |
GraphQLString, | |
GraphQLInt, | |
GraphQLSchema | |
} = graphql |
This file contains 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
<style type="text/css"> | |
/* Import Font */ | |
@font-face { | |
font-family: "Oakes Regular"; | |
src: url(/assets/Oakes-Regular.otf) format("truetype"); | |
font-weight: normal; | |
font-style: normal; | |
} | |
This file contains 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
>>> $artist->fresh()->albums()->first(); | |
string(46) "select * from "artists" where "id" = ? limit 1" | |
string(98) "select * from "albums" where "albums"."artist_id" = ? and "albums"."artist_id" is not null limit 1" | |
=> App\Album {#668 | |
id: "1", | |
artist_id: "2", | |
album_name: "Yeezus", | |
created_at: "2017-03-06 15:22:37", | |
updated_at: "2017-03-06 15:22:37", | |
} |
This file contains 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
PAID_ITEM_COUNT = 2 | |
DISCOUNTED_ITEM_COUNT = 1 | |
def discounted_items_to_find(total_items_seen, discounted_items_seen) | |
Integer(total_items_seen / (PAID_ITEM_COUNT + DISCOUNTED_ITEM_COUNT) * DISCOUNTED_ITEM_COUNT) - discounted_items_seen | |
end | |
def partition(cart, line_items) | |
# Sort the items by price from high to low | |
sorted_items = line_items.sort_by{|line_item| line_item.variant.price}.reverse |
This file contains 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
# NOTICE THIS ISN'T ALPHABETICAL | |
dic = { | |
'Colombia': [48654392, 1090909.09, 'South America'], | |
'China': [1339190000, 9596960.00, 'Asia'] | |
} | |
target = open("save.txt", 'w') | |
# SORTED WILL MAKE IT ALPHABETICAL | |
for i in sorted(dic): |
This file contains 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'); | |
var bcrypt = require('bcrypt-nodejs'); | |
var user = mongoose.Schema({ | |
local: { | |
firstname: String, | |
lastname: String, | |
email: String, | |
password: String | |
}, |
This file contains 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 LocalStrategy = require('passport-local').Strategy; | |
var User = require('../models/user'); | |
module.exports = function(passport){ | |
/* SERIALIZING & DESERIALIZING USERS */ | |
passport.serializeUser(function(user, done){ | |
done(null, user.id); | |
}); | |
passport.deserializeUser(function(id, done){ |
NewerOlder