Skip to content

Instantly share code, notes, and snippets.

@sjvnnings
sjvnnings / better_jumping_character_example.gd
Last active July 23, 2024 05:36
An easy to work with jump in Godot
extends KinematicBody2D
export var move_speed = 200.0
var velocity := Vector2.ZERO
export var jump_height : float
export var jump_time_to_peak : float
export var jump_time_to_descent : float
@MatteoJoliveau
MatteoJoliveau / pageable_type.rb
Created June 21, 2018 07:30
Pageable interface to paginate with Kaminari in GraphQL Ruby
module Types
module PageableType
include Types::Base::Interface
field :current_page, Integer, null: true
field :previous_page, Integer, null: true, method: :prev_page
field :next_page, Integer, null: true
field :total_pages, Integer, null: true
field :total_items, Integer, null: true, method: :total_count
field :size, Integer, null: true, method: :count
field :first_page, Boolean, null: true, method: :first_page?
@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active July 4, 2024 09:06
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@YuMS
YuMS / update-git.sh
Created June 29, 2016 09:28
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@codexico
codexico / install_cocos2d-x.sh
Last active April 27, 2024 20:25
install cocos on ubuntu 16.04
sudo apt-get update
sudo apt-get upgrade
# 1) Download from source, the zip from the site has problems on linux
# https://github.com/cocos2d/cocos2d-x/pull/15958#issuecomment-228919359
git clone https://github.com/cocos2d/cocos2d-x.git
cd cocos2d-x
# 2016-06-27 branch master is broken, change to commit 04d3550
git checkout 04d3550
@mrtns
mrtns / gist:78d15e3263b2f6a231fe
Last active May 19, 2024 06:53
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@StanBoyet
StanBoyet / modal.slim.html
Created September 8, 2014 09:46
Boostrap Modal in Slim
/ Simple Slim translation of Bootstrap modal
.modal.fade.bs-example-modal-lg id="myModal" tabindex='-1' role='dialog' aria-labelledby="Modal Title" aria-hidden='true'
.modal-dialog.modal-lg
.modal-content
.modal-header
button.close type='button' data-dismiss='modal'
span aria-hidden='true' ×
span.sr-only Close
h4.modal-title = "Modal Title"
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@codler
codler / flex.less
Last active October 7, 2023 07:01
Prefix flex for IE10 and Safari / iOS in LESS
/*! Prefix flex for IE10 and Safari / iOS in LESS
* https://gist.github.com/codler/2148ba4ff096a19f08ea
* Copyright (c) 2014 Han Lin Yap http://yap.nu; MIT license */
.display(@value) when (@value = flex) {
display: -ms-flexbox; // IE10
display: -webkit-flex; // Safari / iOS
}
.display(@value) when (@value = inline-flex) {
@tadast
tadast / ssl_puma.sh
Last active January 29, 2024 04:41 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key