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
:root{--current-gap: 0px} | |
.klarna-sdk-button-container{ | |
width:335px; | |
height:48px; | |
display:inline-block | |
} | |
#klarna-sdk-button { | |
container-type:inline-size; | |
container-name:sdk-button-content; | |
position:relative; |
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
function isInsideSFSafariViewController(): boolean { | |
// Only iOS | |
if (!isIOS()) return false; | |
const iosVersion = getIosVersion(); | |
// Can't use this hack in iOS < 15 | |
if (!iosVersion || iosVersion[0] < 15) return false; | |
// In SFSafariViewController, this is a valid font. |
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
SELECT rc.constraint_catalog, | |
rc.constraint_schema||'.'||tc.table_name AS table_name, | |
kcu.column_name, | |
match_option, | |
update_rule, | |
delete_rule | |
FROM information_schema.referential_constraints AS rc | |
JOIN information_schema.table_constraints AS tc USING(constraint_catalog,constraint_schema,constraint_name) | |
JOIN information_schema.key_column_usage AS kcu USING(constraint_catalog,constraint_schema,constraint_name) | |
JOIN information_schema.key_column_usage AS ccu ON(ccu.constraint_catalog=rc.unique_constraint_catalog AND ccu.constraint_schema=rc.unique_constraint_schema AND ccu.constraint_name=rc.unique_constraint_name) |
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
[ | |
{"name": "Jon Snow", "contact": "+6511110000", "latitude": "1.291432", "longitude": "103.821268", "available": true, "user_id": 1}, | |
{"name": "Tyrion Lanister", "contact": "+6522220000", "latitude": "1.285758", "longitude": "103.783870", "available": true, "user_id": 2}, | |
{"name": "Brandon Stark", "contact": "+6533330000", "latitude": "1.289907", "longitude": "103.829398", "available": false, "user_id": 3}, | |
{"name": "Arya Stark","contact": "+6544440000","latitude": "1.312164","longitude": "103.767720", "available": true, "user_id": 4}, | |
{"name": "Cersei Lannister", "contact": "+6555550000", "latitude": "1.310749", "longitude": "103.843629", "available": true, "user_id": 5}, | |
{"name": "Khal Drogo", "contact": "+6566660000", "latitude": "1.286969", "longitude": "103.844563", "available": true, "user_id": 6}, | |
{"name": "Sansa Stark", "contact": "+6577770000", "latitude": "1.273629", "longitude": "103.799448", "available": false, "user_id": 7}, | |
{"name": "Ned Stark", "contact": "+6588880000", "latitude": "1.2 |
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
# This is an example of bad code | |
class Employee | |
attr_accessor :first_name, :last_name | |
def initialize(first_name, last_name) | |
@first_name = first_name | |
@last_name = last_name | |
end | |
end | |
def calculate_pay(employee) |
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
//Directive for file upload | |
app.directive('fileUpload', function () { | |
return { | |
scope: false, | |
link: function (scope, el, attrs) { | |
el.bind('change', function (event) { | |
var files = event.target.files; | |
scope.$emit("fileUploaded", { file: event.target.files[0] }); //since we need only single file upload right now | |
}); |
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 docWidth = document.documentElement.offsetWidth; | |
[].forEach.call( | |
document.querySelectorAll('*'), | |
function(el) { | |
if (el.offsetWidth > docWidth) { | |
console.log(el); | |
} | |
} | |
); |
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
ROLES = %i(student mentor guardian admin td) | |
@roles_mask = nil | |
def set(roles) | |
@roles_mask = (roles & ROLES).map { |r| 2**ROLES.index(r) }.inject(0, :+) | |
end | |
def get | |
ROLES.reject do |r| |
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
def time_iterate(start_time, end_time, step, &block) | |
begin | |
yield(start_time) | |
end while (start_time += step) <= end_time | |
end | |
start_time = Time.parse("2010/1/1") | |
end_time = Time.parse("2010/1/2") | |
time_iterate(start_time, end_time, 1800) do |t| | |
hours.push({:text => t.strftime("%H:%M"), :hour => t.hour}) |