Skip to content

Instantly share code, notes, and snippets.

View lunks's full-sized avatar

Pedro Nascimento lunks

View GitHub Profile
@lunks
lunks / cookie clicker bookmarklet
Last active May 6, 2020 05:38 — forked from met4000/cookie clicker bookmarklet
An autoclick bookmarklet for CC.
query LearnAboutSchema {
__schema {
types {
name
kind
}
queryType {
fields {
name
description
query LearnAboutSchema {
__schema {
types {
name
kind
}
queryType {
fields {
name
description
@lunks
lunks / circle-ci-config.yml
Last active September 4, 2023 21:17
React Native with Expo app publishing in Circle CI
---
version: 2.1
aliases:
- &install_yarn_dependencies
run:
name: Install yarn dependencies
command: yarn install --frozen-lockfile --ignore-engines
- &update_yarn
run:
name: Update yarn
@lunks
lunks / gruvbox-dark.conf
Last active April 25, 2024 04:21
gruvbox-dark theme for kitty - the fast, featureful, GPU based terminal emulator
# gruvbox-dark colorscheme for kitty
# snazzy theme used as base
foreground #ebdbb2
background #272727
selection_foreground #655b53
selection_background #ebdbb2
url_color #d65c0d
# black
@lunks
lunks / output_with_apollo_proxy
Created October 26, 2017 16:26
Apollo Proxy woes
time="2017-10-26T14:24:42-02:00" level=debug msg="Got to backend... about to start query"
Started POST "/graphql" for ::1 at 2017-10-26 14:24:42 -0200
Processing by GraphqlController#execute as */*
Parameters: {"query"=>"query{organization(id:\"1\"){name}}", "variables"=>{"input"=>{"duration"=>"1h", "imageUrl"=>"google.com", "location"=>"Jedi", "points"=>50, "startedAt"=>"2017-05-12", "title"=>"Woot"}, "organizationId"=>"1"}, "operationName"=>"", "extensions"=>nil, "graphql"=>{"query"=>"query{organization(id:\"1\"){name}}", "variables"=>{"input"=>{"duration"=>"1h", "imageUrl"=>"google.com", "location"=>"Jedi", "points"=>50, "startedAt"=>"2017-05-12", "title"=>"Woot"}, "organizationId"=>"1"}, "operationName"=>"", "extensions"=>nil}}
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.3ms)
time="2017-10-26T14:24:42-02:00" level=debug msg="Capturing trace." bucket=93 isError=true signature="que
@lunks
lunks / implicit_resolver_instrumentation.rb
Last active October 19, 2017 02:28
Implicit Resolver for GraphQL Ruby
class ImplicitResolverInstrumentation
def instrument(_type, field)
implicit_resolver = "Resolvers::#{field.name.camelize}".safe_constantize
if implicit_resolver && default_or_connection_resolver?(field)
field.redefine do
resolve implicit_resolver
end
else
field
@lunks
lunks / resolver.rb
Last active September 5, 2017 14:40
GraphQL resolver example with tests
module Resolvers
class CreateEvent
include Pundit
def self.call(*args)
new(*args).resolve
end
attr_reader :current_user
tell application "System Events"
key code 144 using {command down}
end tell
@lunks
lunks / _angularjs_and_rails_asset_pipeline.md
Last active September 19, 2015 22:11 — forked from stevenharman/_angularjs_and_rails_asset_pipeline.md
Load the Angular.js $templateCache while building assets for Rails Asset Pipeline. Be sure in require the `templates` module as a dependency of your Angular.js app.

AngularJS + Rails Asset Pipeline updated to Sprockets 3 + other changes

Updates:

  • Sprockets 3 doesn't seem to need me to inject JavascriptHelpers.
  • Using environment[file].to_s to fetch the compiled sources.
  • Everything in my app (templates and scripts) is inside an app/ folder which is my angular app, so I leave that path part out on the $templateCache key
  • I'm only supporting slim templates because I only use slim, but it should fairly easy to add other template engines.
  • The previous script broke on files like course-link.directive.slim. We just remove the .slim extension now.