Skip to content

Instantly share code, notes, and snippets.

View taeguk's full-sized avatar
❄️
asdf

Taeguk Kwon taeguk

❄️
asdf
View GitHub Profile
@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@ncornwell
ncornwell / ParyCudaSearch
Created April 27, 2011 01:16
Binary Search in CUDA
// kernel.cu : Defines the entry point for the console application.
//
#include "kernel.h"
#include <stdio.h>
#include <stdlib.h>
#include <cuda.h>
#include <cutil.h>
#include <cuda_runtime.h>
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@mpilquist
mpilquist / RWS.scala
Created April 12, 2012 01:41
Initial attempt at using Tony Morris's ReaderWriterStateT monad transformer (see https://gist.github.com/2360532)
object RWS extends App {
trait Pointed[P[_]] {
def point[A](a: A): P[A]
}
trait PointedFunctor[PF[_]] extends Pointed[PF] with Functor[PF]
implicit def listIsMonoid[A]: Monoid[List[A]] = new Monoid[List[A]] {
def id: List[A] = Nil
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 3, 2024 16:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@travisbrown
travisbrown / tuple-flatten.scala
Created October 24, 2012 11:18
Flattening deeply nested tuples with Shapeless
import shapeless._
trait Flatten[I, O <: HList] {
def apply(i: I): O
}
trait FlattenLow {
implicit def otherFlatten[I] = new Flatten[I, I :: HNil] {
def apply(i: I) = i :: HNil
}
@higemaru
higemaru / gist:5863873
Last active April 19, 2021 11:25
GIT_COMMITTER_DATE / GIT_AUTHOR_DATE
export GIT_COMMITTER_DATE="Fri Jun 21 20:26:41 2013 +0900"
git commit --amend --date "Fri Jun 21 20:26:41 2013 +0900" -m 'fix committer_date and author_date'
unset GIT_COMMITTER_DATE
export GIT_COMMITTER_DATE="2013-08-01 23:01:01 +0900"
git commit --amend --date "2013-08-01 23:01:01 +0900" -m 'fix committer_date and author_date'
unset GIT_COMMITTER_DATE
@barrysteyn
barrysteyn / Base64.md
Last active April 9, 2024 08:29
OpenSSL Base64 En/Decode: Portable and binary safe.

OpenSSL Base64 Encoding: Binary Safe and Portable

Herewith is an example of encoding to and from base64 using OpenSSL's C library. Code presented here is both binary safe, and portable (i.e. it should work on any Posix compliant system e.g. FreeBSD and Linux).

License

The MIT License (MIT)

Copyright (c) 2013 Barry Steyn

@aaronhurt
aaronhurt / curltest.c
Last active November 26, 2023 10:29
example code using libcurl and json-c to post and parse a return from http://jsonplaceholder.typicode.com
/**
* example C code using libcurl and json-c
* to post and return a payload using
* http://jsonplaceholder.typicode.com
*
* License:
*
* This code is licensed under MIT license
* https://opensource.org/licenses/MIT
*