Skip to content

Instantly share code, notes, and snippets.

View keichan34's full-sized avatar
👋
Hello!

Keitaroh Kobayashi keichan34

👋
Hello!
View GitHub Profile
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active March 29, 2024 08:31
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@missinglink
missinglink / wrap.js
Last active March 19, 2024 22:44
wrap latitude and longitude values around the poles in order to normalize their ranges
/**
normalize co-ordinates that lie outside of the normal ranges.
longitude wrapping simply requires adding +- 360 to the value until it comes
in to range.
for the latitude values we need to flip the longitude whenever the latitude
crosses a pole.
**/
@marcelog
marcelog / aws-sqs.policy
Last active December 4, 2023 07:07
SQS Policy to allow an S3 bucket to publish messages
{
"Version": "2012-10-17",
"Id": "arn:aws:sqs:YOUR-AWS-REGION:YOUR-AWS-ACCOUNT-ID:YOUR-QUEUE-NAME/SQSDefaultPolicy",
"Statement": [
{
"Sid": "example-statement-ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@maxim
maxim / rails_load_path_tips.md
Last active April 13, 2023 13:28
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@potatosalad
potatosalad / hashquiz.rb
Created December 31, 2010 04:36
Ruby quiz for convert hash "dot paths" into actual hash hierarchy.
#require 'rubygems'
require 'pp'
#require 'ap' # Awesome Print
class Object
# expects [ [ symbol, *args ], ... ]
def recursive_send(*args)
args.inject(self) { |obj, m| obj.send(m.shift, *m) }
end
end
@marcoarment
marcoarment / ATPLogoView.m
Created April 29, 2014 21:07
Source for the Accidental Tech Podcast (ATP) T-Shirt
// Source for the Accidental Tech Podcast (ATP) T-Shirt:
// http://www.marco.org/2014/04/29/atp-shirts
//
// By Marco Arment, April 28, 2014. MIT license.
@implementation ATPLogoView
- (void)drawRect:(CGRect)rectIgnored
{
NSString *fontName = @"MyriadPro-Semibold";
module PumaCapacityToCloudwatch
require 'puma_capacity_to_cloudwatch/utilization'
require 'puma_capacity_to_cloudwatch/publish'
class Error < StandardError; end
def self.run
sleep 10 # wait for puma to boot up
return unless defined?(Puma)
@joshrieken
joshrieken / Gulpfile.js
Last active July 10, 2019 15:33
Replacing Brunch with Gulp in Phoenix
// Contains support for: SASS/SCSS, concatenation, and minification for JS and CSS
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var concat = require('gulp-concat');
var compress = require('gulp-yuicompressor');
@jeremy-w
jeremy-w / blurb.fish
Created March 10, 2017 20:00
Fish function to create or reply to a social post on 10 Centuries. MPLv2
function blurb --description Post\ to\ 10C.\\nblurb\ post\ MESSAGE\\nblurb\ POST_ID\ REPLY --argument reply_id message
set -l token $TEN_CENTURIES_API_TOKEN
set -l endpoint https://api.10centuries.org/content/write
set -l usage 'blurb: post or reply to a message on 10C
Usage:
blurb post MESSAGE
Post a new blurb