Skip to content

Instantly share code, notes, and snippets.

View nafu's full-sized avatar
🧗
Keep exploring

Fumiya Nakamura nafu

🧗
Keep exploring
View GitHub Profile
@fkino
fkino / esm_bento.rb
Created September 5, 2016 05:34
Code on the Bento Wrapping Paper at RubyKaigi 2016
eval(
%w( put
s(([ 2*7,
2*31 ,1,3
*3*5 ,2*2
*2*2 *3].
map{ |c|c
.to_ s(5*7
).gs ub("1 ","
\s") .upca se}.
# VERSION 1.0.4
# Author: @madhavajay
# This currently works for iOS and watchOS in the Simulator and Devices
# Changes
# Using ${TOOLCHAIN} in two places now
# Added double quotes " around paths
# Fixed watchOS Issues
# Instructions iOS
Project # of Top 100 Free Apps (US)
facebook-ios-sdk 67
Bolts-iOS 48
AFNetworking 39
Google-Mobile-Ads-SDK 38
Reachability (Apple) 38
Crashlytics 37
Flurry-iOS-SDK 31
CocoaPods 30
GoogleConversionTracking 29
@noeldelgado
noeldelgado / github-graph-colours-changer.js
Last active March 8, 2020 23:05
Copy and paste the code on your github profile page to change the graph colours... (DevTools » Console)
// var GH = ['#EEEEEE', '#D6E685', '#8CC665', '#44A340', '#1E6823']; /* previous GH colors */
var GH = ['#EBEDF0', '#C6E48B', '#7BC96F', '#239A3B', '#196127'];
var CO = ['#EF4B4D', '#F89B47', '#FAEA20', '#7DC242', '#5D94CE', '#855CA7'];
var graph = document.getElementsByClassName('js-calendar-graph-svg')[0];
var days = [].slice.call(graph.getElementsByTagName('rect'), 0);
days.forEach(function(rect) {
switch(rect.getAttribute('fill').toUpperCase()) {
case GH[0]: rect.setAttribute('fill', CO[2]); break; // yellow
@stigi
stigi / CocoaLumberjack.swift
Created August 16, 2014 21:41
A little hack to work comfortably with cocoa lumberjack in Swift.
// Created by Ullrich Schäfer on 16/08/14.
// Bitmasks are a bit tricky in swift
// See http://natecook.com/blog/2014/07/swift-options-bitmask-generator/
//enum LogFlag: Int32 {
// case Error = 0b1
// case Warn = 0b10
// case Info = 0b100
@flenter
flenter / wercker.yml
Last active December 25, 2015 14:39
wercker.yml for php with a yui compressor step
box: wercker/php
# Build definition
build:
# The steps that will be executed on build
steps:
# A custom script s tep, name value is used in the UI
# and the code value contains the command that get executed
- script:
name: echo php information
code: |
@jordelver
jordelver / gist:5304643
Last active March 6, 2018 21:46
zsh file renaming using zmv

zsh file renaming using zmv

Load the zmv function, best place is in ~/.zshrc

autoload zmv

Rename files using regex captures

Take filenames likes image0001.jpg and rename to 0001.jpg

@kwatch
kwatch / gist:2814940
Created May 27, 2012 16:18
Rubyの特殊変数一覧
$! raise された例外オブジェクト
$" require で読み込まれたファイルの配列
$#
$$ 現在のプロセス ID
$%
$& 正規表現にマッチした箇所の文字列
$' 正規表現にマッチした箇所より後ろの文字列
$(
$)
$* Ruby スクリプトに指定された引数。ARGV と同じ
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@objectoriented
objectoriented / aws_cf_invalidate.rb
Created September 28, 2010 17:37 — forked from jmlacroix/aws_cf_invalidate.rb
Ruby script to invalidate objects on Amazon's CloudFront CDN (shows status of recent requests also)
require 'rubygems'
require 'hmac-sha1' # on OS X: sudo gem install ruby-hmac
require 'net/https'
require 'base64'
#
# CHANGE ME: S3 access credentials go here, along with CloudFront Distribution ID
#
s3_access=''
s3_secret=''