Skip to content

Instantly share code, notes, and snippets.

View AstraL's full-sized avatar
🎯
Focusing

Eugene Chernenko AstraL

🎯
Focusing
  • Milestep LLC
  • Ukraine, Cherkassy
View GitHub Profile
@AstraL
AstraL / api.js
Last active October 4, 2022 08:47
import { requestManager } from './';
/* please keep these name singular *
* i.e 'card' instead of 'cards', etc... */
export default {
activity: {
get: () =>
requestManager.get('/api/activities')
},
@AstraL
AstraL / current_user.rb
Last active June 17, 2022 10:28
Rails login
def current_user
headers = request.headers
cookies[:jwt] = headers['X-Token'] if !cookies[:jwt] && headers['X-Token'].present?
result = Cookies::Decode.({}, cookies: cookies)
return unless result.success? && result[:decoded_jwt]
@current_user ||= User.includes(:user_identities)
.find_by(auth_token: result[:decoded_jwt][:auth_token])
@AstraL
AstraL / flake.rb
Last active November 17, 2021 10:08
require "active_job"
require "active_model"
class Flake < ActiveJob::Base
alias ActiveJob::Core#initialize before it is overwritten by ActiveModel::Model
alias active_job_initialize initialize
include ::ActiveModel::Model
include FlakeHelper
@AstraL
AstraL / template.json
Last active December 29, 2023 18:19
Portainer templates
[
{
"type": "container",
"title": "Registry",
"description": "Docker image registry",
"categories": ["docker"],
"platform": "linux",
"logo": "https://portainer-io-assets.sfo2.digitaloceanspaces.com/logos/registry.png",
"image": "registry:latest",
"ports": [
@AstraL
AstraL / shadow.css
Created March 2, 2016 12:42
Text shadow bold
/* Slim line */
h1 {
text-shadow: red 1px 0px, red 1px 1px, red 0px 1px, red -1px 1px, red -1px 0px, red -1px -1px, red 0px -1px, red 1px -1px;
}
/* Bold line */
h1 {
text-shadow: red 1px 0px, red 1px 1px, red 0px 1px, red -1px 1px, red -1px 0px, red -1px -1px, red 0px -1px, red 1px -1px, red 0 0 3px, red 0 0 3px, red 0 0 3px, red 0 0 3px, red 0 0 3px, red 0 0 3px, red 0 0 3px, red 0 0 3px;
}
@AstraL
AstraL / responsive.css
Created January 26, 2016 14:39
Media Queries for Standard Devices
/* ----------- iPhone 4 and 4S ----------- */
/* Portrait and Landscape */
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2) {
}