This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| Retrieve intraday stock data from Google Finance. | |
| """ | |
| import csv | |
| import datetime | |
| import re | |
| import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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\/)/); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -x | |
| # ================================== | |
| # iptables default configuration script | |
| # | |
| # - this locks down our servers port access | |
| # ================================== | |
| # install fail2ban | |
| sudo apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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 "***") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| m, s = divmod(seconds, 60) | |
| h, m = divmod(m, 60) | |
| print "%d:%02d:%02d" % (h, m, s) |