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
/*! | |
* jQuery JavaScript Library v3.7.0 | |
* https://jquery.com/ | |
* | |
* Copyright OpenJS Foundation and other contributors | |
* Released under the MIT license | |
* https://jquery.org/license | |
* | |
* Date: 2023-05-11T18:29Z | |
*/ |
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
export class Client { | |
Success = 'Success'; | |
Error = 'Error'; | |
async getData(path) { | |
let fullPath = path; | |
const result = await fetch(fullPath, { | |
method: 'GET', | |
headers: { | |
Accept: 'application/json', |
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
# /app/admin/api_key.rb | |
ActiveAdmin.register ApiKey do | |
include UserFilter | |
controller do | |
def permitted_params | |
params.permit! | |
end | |
end | |
end |
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
module TrackedRetries | |
def with_tracked_retries(sync_record, max_attempts: 3) | |
attempts = 0 | |
begin | |
attempts += 1 | |
sync_record.update(attempts: attempts) | |
yield | |
sync_record.update(success: true) |
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
application_controller.rb | |
... | |
private | |
def authenticate_user! | |
super | |
check_user_active! | |
end |
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
import time, datetime, sys | |
import RPi.GPIO as GPIO | |
sense_pin = 7 | |
LED_pin = 36 | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(sense_pin, GPIO.IN) | |
GPIO.setmode(LED_pin, GPIO.OUT) | |
last_time = time.time() |
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
<html> | |
<head> | |
<style type='text/css'> | |
body, html { | |
margin: 0; | |
padding: 0; | |
} | |
body { | |
color: black; | |
display: table; |
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
import React, { Component } from 'react'; | |
import TextField from 'components/base/TextField'; | |
const WAIT_INTERVAL = 1000; | |
const ENTER_KEY = 13; | |
export default class TextSearch extends Component { | |
constructor(props) { | |
super(); |
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 how it is done, even in Rails 4 | |
gem 'will_paginate' | |
@stripe_events = StripeEvent.paginate(:page => params[:page], :per_page => 20) | |
<% will_paginate @stripe_events %> |
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
gem install GEM_NAME -v SPECIFIC_VERSION | |
e: gem install autoprefixer-rails -v 5.0.0.1 |
NewerOlder