Skip to content

Instantly share code, notes, and snippets.

View foloinfo's full-sized avatar
🏖️
Happy coding

foloinfo foloinfo

🏖️
Happy coding
View GitHub Profile
@foloinfo
foloinfo / file0.txt
Created October 26, 2012 09:30
apt-getでnginx-1.2.4 stableをubuntu 11.10にインストール ref: http://qiita.com/items/3c5d3c13df65fb8e581d
$ wget http://nginx.org/keys/nginx_signing.key
$ sudo apt-key add nginx_signing.key
$ sudo vim /etc/apt/sources.list
+ deb http://nginx.org/packages/ubuntu/ oneiric nginx
+ deb-src http://nginx.org/packages/ubuntu/ oneiric nginx
$ apt-get update
# Get:1 http://nginx.org oneiric Release.gpg [287 B] とかちゃんと取ってきてるのを確認
$ apt-get install nginx
# Setting up nginx (1.2.4-1~oneiric) ...
@foloinfo
foloinfo / file0.r
Created November 19, 2013 05:40
Rからerb記述が含まれるyamlを読み込む ref: http://qiita.com/foloinfo/items/9ce4662953f9ace094e1
> system('ruby -e "puts 1+1"', intern=TRUE)
[1] "2"
> system("ruby script.rb", intern=T)
@foloinfo
foloinfo / resque.rake
Last active August 29, 2015 13:56 — forked from denmarkin/resque.rake
# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version
# see https://github.com/defunkt/resque/issues/49
# see http://redis.io/commands - new commands
namespace :resque do
desc "Clear pending tasks"
task :clear => :environment do
queues = Resque.queues
queues.each do |queue_name|
puts "Clearing #{queue_name}..."
if (WebViewBridge) {
document.addEventListener('selectionchange', function(){
var body = document.getSelection().toString();
var object = { "type": "select", body: body }
WebViewBridge.send(JSON.stringify(object));
});
}
Verifying my Blockstack ID is secured with the address 1KcLD7r8UgtuMkqvUHQsjEjgHF1CjJxvkX https://explorer.blockstack.org/address/1KcLD7r8UgtuMkqvUHQsjEjgHF1CjJxvkX
Verifying that "foloinfo.id" is my Blockstack ID. https://explorer.blockstack.org/name/foloinfo.id
@foloinfo
foloinfo / amazon-calc.js
Created November 24, 2017 01:15 — forked from l-rutong/amazon-calc.js
Amazon購入履歴のCSVエクスポート (2017 年バージョン)
// Amazon購入履歴のCSVエクスポート
//
// 使い方:
// 1. 全部コピーする (右上の Raw をクリックした先でやるのが楽)
// 2. Amazon の注文履歴ページ ( https://www.amazon.co.jp/gp/css/order-history/ ) を開く
// 3. F12 または 右クリ→要素の検証 とかで出てくる開発者ツールのコンソール (JavaScript REPL) にペースト
// 4. エンターで実行
// (Firefox はなんか allow pasting とタイプしろみたいなことを言われるので従う)
// 5. しばらく待つと、コンソールに合計金額が表示され、CSVが保存される
//
@foloinfo
foloinfo / .js
Last active March 31, 2021 13:15
Workaround for uploading files from `assets-library` path on iOS with expo
// img
// {
// uri: '"assets-library://asset/asset.JPG?id=SOME_ID&ext=JPG"',
// md5: "some md5"
// }
// copy into cache dir first
const path = FileSystem.cacheDirectory + img.md5
await FileSystem.copyAsync({
from: img.uri,
@foloinfo
foloinfo / UseMetaTagScreen.js
Last active December 15, 2020 01:33
react meta tags with react-navigation
...
import useMetaTags from 'hooks/useMetaTags'
const UseMetaTagScreen = props => {
// it will set / unset meta tags on screen enter / leave
useMetaTags({ robots: 'noindex' })
...
@foloinfo
foloinfo / firacode.css
Last active March 26, 2021 03:20
firacode.css
@font-face{
font-family: 'Fira Code';
src: url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/eot/FiraCode-Regular.eot') format('embedded-opentype'),
url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/woff2/FiraCode-Regular.woff2') format('woff2'),
url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/woff/FiraCode-Regular.woff') format('woff'),
url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/ttf/FiraCode-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}