Skip to content

Instantly share code, notes, and snippets.

View kyontan's full-sized avatar
♨️

kyontan kyontan

♨️
View GitHub Profile
@matsumotory
matsumotory / gist:4993058
Created February 20, 2013 05:08
embeddable microhttpd
//
// gcc -lmicrohttpd mhd.c
//
#include <string.h>
#include <sys/types.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <microhttpd.h>
@hs0ucy
hs0ucy / media-queries-samples.css
Created September 21, 2012 17:48
Media Queries for Standard Devices
/*
* From css-tricks.com
* http://css-tricks.com/snippets/css/media-queries-for-standard-devices/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
@Gab-km
Gab-km / github-flow.ja.md
Last active April 23, 2025 04:19 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
anonymous
anonymous / gist:2979612
Created June 23, 2012 19:28
Twitter OAuth
def consumer
OAuth::Consumer.new(TWITTER_CONSUMER_KEY,TWITTER_CONSUMER_SECRET,{:site=>"http://twitter.com" })
end
def loginTwitter
@req_token = consumer.get_request_token(:oauth_callback=>"http://127.0.0.1:3000/login/twitter/success")
session[:request_token] = @req_token.token
session[:request_token_secret] = @req_token.secret
redirect_to @req_token.authorize_url
end
@theconektd
theconektd / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@repeatedly
repeatedly / d_master.md
Last active December 17, 2024 10:01
D言語基礎文法最速マスター

他の言語をある程度知っている人はこれを読めばD言語の基礎をマスターでき,D言語の氷山の一角くらいは知ることができると思います.対象バージョンはdmd 2.059です.

1. 基礎

ソースファイル

ASCIIかUTFしか受け付けません.それ以外の文字コードで書くとコンパイルエラーになります.

main

D言語のmainはCとは違い以下のようなシグネチャです.

@btoone
btoone / curl.md
Last active December 8, 2024 05:16
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@edwardhotchkiss
edwardhotchkiss / syntax.css
Created March 9, 2012 04:34 — forked from scotu/solarized.css
Solarized Light Pygments CSS / Jekyll
.highlight {
background-color: #efefef;
padding: 7px 7px 7px 10px;
border: 1px solid #ddd;
-moz-box-shadow: 3px 3px rgba(0,0,0,0.1);
-webkit-box-shadow: 3px 3px rgba(0,0,0,0.1);
box-shadow: 3px 3px rgba(0,0,0,0.1);
margin: 20px 0 20px 0;
overflow: hidden;
@rstacruz
rstacruz / index.md
Last active April 28, 2025 21:24
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@tpitale
tpitale / lib-sunspot-data_mapper.rb
Created October 16, 2011 16:18 — forked from dkubb/dm_sunspot.rb
DataMapper and Sunspot Integration Extension
module Sunspot
module DataMapper
def self.included(base)
base.class_eval do
alias new_record? new?
end
base.extend Sunspot::Rails::Searchable::ActsAsMethods
Sunspot::Adapters::DataAccessor.register(DataAccessor, base)