Skip to content

Instantly share code, notes, and snippets.

View henteko's full-sized avatar
😻
💯💯💯💯💯💯💯💯

henteko henteko

😻
💯💯💯💯💯💯💯💯
View GitHub Profile
@henteko
henteko / Ti.UI.ImageView#imageWithCache
Created September 29, 2011 07:37 — forked from func09/Ti.UI.ImageView#imageWithCache
TitaniumのImageViewでリモートURLの画像を永続的にキャッシュする
$$$ = {};
$$$.ui = {};
$$$.ui.createImageView = function(options){
var ui = Ti.UI.createImageView(options);
// 画像を永続化してキャッシュ
ui.imageWithCache = function(url){
url = url.replace(/\?[0-9]+$/,'');
@henteko
henteko / gist:2937402
Created June 15, 2012 16:24
henteko code
bool num_check(char c) {
return c >= 48 && c <= 57;
}
@henteko
henteko / 20121003.cpp
Created October 3, 2012 10:17
Project Euler #73
#include<iostream>
using namespace std;
int gcd(int a,int b) {
if(a == b) return a;
if(a < b) return gcd(a,b-a);
if(a > b) return gcd(a-b,b);
}
@henteko
henteko / index.php
Created October 16, 2012 06:33
iframe内からリダイレクト
<?php
$uri = "https://www.facebook.com/hoge/app_hgoehoge";
print "<script type='text/javascript'>top.location.href='" . $uri . "';</script>";
exit;
?>
@henteko
henteko / setup_proxy4UEC.sh
Created October 26, 2012 18:12
proxy setup sh
#!/bin/sh
PROXY="proxy url"
PORT=port_num
networksetup -setwebproxy Wi-Fi ${PROXY} ${PORT}
networksetup -setsecurewebproxy Wi-Fi ${PROXY} ${PORT}
@henteko
henteko / unsetup_proxy4UEC.sh
Created October 26, 2012 18:13
proxy unsetup sh
#!/bin/sh
networksetup -setwebproxystate Wi-Fi off
networksetup -setsecurewebproxystate Wi-Fi off
@henteko
henteko / algorithm1.c
Created November 10, 2012 08:30
report
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define BUFLEN 80
#define STKLMT 100
char STACK[STKLMT];
int StkCtr;
@henteko
henteko / TestSample.cpp
Created December 15, 2012 02:43
C++ TestSample.
#include<sstream>
#include<iostream>
#include<vector>
#include<list>
#include<string>
using namespace std;
class TestSample {
public:
int wordlen(string word) {
@henteko
henteko / baners.css
Created December 17, 2012 09:24
bodyで text-align: center; してるけど、 <div id="baners">ばなーとか</div> はこのtext-alignに含まれない(divだから、spanとかだと含まれる)からセンタリングされないみたい だから、CSSの#banersの所を以下のようにすればおk
#baners {
width: 500px;
line-height: 40px;
padding: 10px;
/****************
* 以下を追加する
****************/
margin-left: auto;
margin-right: auto;
@henteko
henteko / ValueHistogram.cpp
Created December 20, 2012 18:28
SRM565 250
class ValueHistogram {
public:
vector <string> build(vector <int> values) {
vector <string> result;
vector<int> c(10, 0);
vector<string> s(51, "..........");
for(int i=0;i < values.size();i++) {
s[c[values[i]]][values[i]] = 'X';
c[values[i]]++;