Skip to content

Instantly share code, notes, and snippets.

View yat1ma30's full-sized avatar
🐕
On vacation

URA yat1ma30

🐕
On vacation
View GitHub Profile
@yat1ma30
yat1ma30 / 0_reuse_code.js
Created July 16, 2017 13:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@yat1ma30
yat1ma30 / google_finance_intraday.py
Created June 24, 2017 22:31 — forked from lebedov/google_finance_intraday.py
Retrieve intraday stock data from Google Finance.
#!/usr/bin/env python
"""
Retrieve intraday stock data from Google Finance.
"""
import csv
import datetime
import re
import pandas as pd
@yat1ma30
yat1ma30 / youtubeID.js
Created October 27, 2015 03:42 — forked from takien/youtubeID.js
Get YouTube ID from various YouTube URL using JavaScript
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
@yat1ma30
yat1ma30 / allauth_avatar.py
Created October 1, 2015 07:31 — forked from pennersr/allauth_avatar.py
Support for copying profile pictures into django-avatar was removed from django-allauth. This gist contains example code that you can drop into your own project in order to reinstate that functionality.
import urllib2
from django.template.defaultfilters import slugify
from django.core.files.base import ContentFile
from django.dispatch import receiver
from avatar.models import Avatar
from allauth.account.signals import user_signed_up
@yat1ma30
yat1ma30 / bootstrap-japanese.css
Last active August 16, 2016 06:13
日本語フォントに対応 for bootstrap v3
.alert, .badge, .breadcrumb, .btn, .form-control, .input-gruop, .label, .lead, .list-group, .nav-pills, .nav-tabs, .navbar, .no-thank-yu, .pager, .pagination, .panel-heading, .panel-title, .popover, .tooltip {
font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,"ヒラギノ角ゴ ProN W3","Hiragino Kaku Gothic ProN","メイリオ",Meiryo,sans-serif;
}
body {
font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,"游ゴシック",YuGothic,"ヒラギノ角ゴ ProN W3","Hiragino Kaku Gothic ProN","メイリオ",Meiryo,sans-serif;
font-size: 16px;
line-height: 1.42857;
}
@yat1ma30
yat1ma30 / iptables.sh
Last active August 29, 2015 14:27 — forked from sandcastle/iptables.sh
Default firewall configuration using iptables for a fresh Ubuntu 14.04 server.
#!/bin/sh -x
# ==================================
# iptables default configuration script
#
# - this locks down our servers port access
# ==================================
# install fail2ban
sudo apt-get update
@yat1ma30
yat1ma30 / transparent-gif.js
Last active August 29, 2015 14:26 — forked from sspencer/transparent-gif.js
Serve a transparent GIF from NodeJS
// Two ways to serve transparent GIF
var buf = new Buffer([
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x01, 0x00, 0x01, 0x00,
0x80, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x2c,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02,
0x02, 0x44, 0x01, 0x00, 0x3b]);
res.send(buf, { 'Content-Type': 'image/gif' }, 200);
@yat1ma30
yat1ma30 / gist:b7c358eca9795bbabb18
Created June 15, 2015 11:10
aojにサブミットするel
(require 'cl)
(require 'deferred)
(require 'http-get)
(require 'xml)
(require 'url)
(setq aoj-url "http://judge.u-aizu.ac.jp/onlinejudge")
(setq aoj-passwd "***")
(setq aoj-id "***")
@yat1ma30
yat1ma30 / cursorsio.js
Created January 28, 2015 12:52
http://cursors.io/ のソースコード
(function(A, E) {
function sa(f) {
return f << 1
}
function ta(f) {
return f << 1
}
function U() {
return E.pointerLockElement === y || E.mozPointerLockElement === y || E.webkitPointerLockElement === y
}
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
print "%d:%02d:%02d" % (h, m, s)