Skip to content

Instantly share code, notes, and snippets.

View dongri's full-sized avatar
🥃

Dongri Jin dongri

🥃
View GitHub Profile
@DaveWoodCom
DaveWoodCom / fixXcode6OnElCapitan.sh
Last active September 8, 2023 21:02
Script to fix Xcode 6.x so that it will run on El Capitan
#!/bin/bash
## Copyright (C) 2015 Cerebral Gardens http://www.cerebralgardens.com/
##
## Permission is hereby granted, free of charge, to any person obtaining a copy of this
## software and associated documentation files (the "Software"), to deal in the Software
## without restriction, including without limitation the rights to use, copy, modify,
## merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
## permit persons to whom the Software is furnished to do so, subject to the following
## conditions:
package main
import (
"fmt"
"io"
"log"
"os"
)
var target_path string
@matsubo
matsubo / credit_card_bin_codes.md
Last active June 11, 2024 05:23
Credit Card Bin Codes

概要

クレジットカード番号には法則があり、先頭6桁でカードの種類を識別、分類することができる。

詳細はISO/IEC 7812で規定されている。

ISO/IEC 7812 - Wikipedia https://ja.wikipedia.org/wiki/ISO/IEC_7812

先頭の6桁を銀行識別番号(Bank Identification Number、略称:BIN)ないしは発行者識別番号(Issuer Identification Number、略称:IIN)と呼び、この先頭6桁でカード発行会社(イシュア、issuer)が判るようになっている。

@adamalex
adamalex / .ebextensions--eb.config
Created October 28, 2013 00:01
Config and CI script for automated Node.js 0.10.10 project deployment—including grunt—to Elastic Beanstalk
packages:
yum:
git: []
gcc: []
make: []
openssl-devel: []
commands:
00-add-home-variable:
command: sed -i 's/function error_exit/export HOME=\/root\n\nfunction error_exit/' /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh
container_commands:
@n_map = { 1 => "0", 2 => "1", 3 => "2", 4 => "3", 5 => "4", 6 => "5",
7 => "6", 8 => "7", 9 => "8", 10 => "9", 11 => "a", 12 => "b",
13 => "c", 14 => "d", 15 => "e", 16 => "f", 17 => "g", 18 => "h",
19 => "i", 20 => "j", 21 => "k", 22 => "l", 23 => "m", 24 => "n",
25 => "o", 26 => "p", 27 => "q", 28 => "r", 29 => "s", 30 => "t",
31 => "u", 32 => "v", 33 => "w", 34 => "x", 35 => "y", 36 => "z",
37 => "A", 38 => "B", 39 => "C", 40 => "D", 41 => "E", 42 => "F",
43 => "G", 44 => "H", 45 => "I", 46 => "J", 47 => "K", 48 => "L",
49 => "M", 50 => "N", 51 => "O", 52 => "P", 53 => "Q", 54 => "R",
55 => "S", 56 => "T", 57 => "U", 58 => "V", 59 => "W", 60 => "X",
@simpx
simpx / gist:2226159
Created March 28, 2012 13:26
Weibo Oauth2 use OAuth2 gem
require 'oauth2'
require 'json'
OAuth2::Response.register_parser(:text, 'text/plain') do |body|
parsed_body = JSON.parse(body)
parsed_body
end
client = OAuth2::Client.new(YOU_KEY, YOU_SECRET, :site => "https://api.weibo.com", :authorize_url => "/oauth2/authorize", :token_url => "/oauth2/access_token")
puts client.auth_code.authorize_url(:redirect_uri => YOUR_CALLBACK_URL)
token = client.auth_code.get_token('authorization_code_value', :redirect_uri => YOUR_CALLBACK_URL)