Skip to content

Instantly share code, notes, and snippets.

View dalinaum's full-sized avatar
:octocat:
Learning Rust and IR.

LYK dalinaum

:octocat:
Learning Rust and IR.
View GitHub Profile
@dalinaum
dalinaum / a.json
Created September 29, 2015 19:12
{
"stage": 0,
"env": {
"development": {
"plugins": ["react-transform"],
"extra": {
"react-transform": {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
@sairion
sairion / Starting with Webpack.md
Last active August 29, 2015 14:18
Starting with Webpack.md

Webpack을 사용한 현대적 자바스크립트 개발 시작하기

Webpack은 @sokra(Tobias Koppers)와 컨트리뷰터들이 구현하고 있는 자바스크립트 기반의 모듈 번들러와 그를 받쳐주는 라이브러리(webpack/lib), 그리고 에코시스템(플러그인, 로더)들을 의미합니다.

스포카에서는 2014년 12월부터 React.js를 전면 도입하여 새 버젼의 적립 애플리케이션을 제작하고 있습니다. 이 개발 과정을 뒷받침해주고 있는 가장 중요한 도구를 말하라고 한다면 두말할 것도 없이 Webpack일 것입니다.

사실 Node.js나 파이썬 같은 환경에서 개발을 해본 사람들에게는 모듈이라는 개념이 익숙하지만, 웹 프론트엔드 개발자에게 모듈이라는 개념은 조금 낯설 수 있는 것이 사실입니다. require.js와 같은 AMD 시스템 또는 Browserify같은 도구를 이용해 본 경험이 없다면 말이죠.

모듈이라는 것은 굉장히 중요합니다. 모듈 시스템을 갖춘 환경에서 일해본 사람은 어떤 이유에서든 그 중요성에 모두 공감할 것입니다. 하지만 웹에는 표준적인 개념의 모듈이라는 것이 없었습니다 (사실 아직도 제대로 된 것은 딱히 없습니다만). 그렇기 때문에 자바스크립트 모듈을 사용하기 위해서는 모듈을 다룰 수 있는 시스템 (RequireJS, CommonJS 등)이 필요하고, 모듈들의 내용과 export들을 이해하고 원하는 형태로 변형할 수 있는 도구가 필요합니다. Webpack과 Browserify는 이런 것을

@givenjazz
givenjazz / gist:5626084
Last active April 19, 2016 12:39
It's BitmapCache for ImageLoader.ImageCache of Volley. It rarely use memory through WeakReference. And it's thread-safety.
/*
* Copyright 2013 Hi Zeon
* Copyright 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@JakeWharton
JakeWharton / OkHttpStack.java
Created May 21, 2013 01:14
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/
@acidsound
acidsound / TinyGCMServer.go
Last active December 14, 2015 17:19
1. go get github.com/googollee/go-gcm 2. go build TinyGCMServer.go 3. ./TinyGCMServer.go <API_KEY> <Server URL(:port)>
// +build !appengine
package main
/*
* Usage: ./TinyGCMServer <API_KEY> <Server URL(:port)>
* Test: curl -d "<NOTIFICATION MESSAGE>" http://serverURL/sendMessage?target=<REGISTRATION_ID>
*/
import (
"fmt"
gcm "github.com/googollee/go-gcm"
@suapapa
suapapa / gdg_events.go
Last active December 12, 2015 07:28
Practice to retrieve and parse GDG chapter's event feed.
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"time"
@devunwired
devunwired / GifDecoder.java
Last active January 26, 2024 21:14
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@f2prateek
f2prateek / CheckBoxActionProvider.java
Created October 30, 2012 18:26
Custom Action Provider in ActionBar - a checkbox with a textview descrption
package com.psrivastava.deviceframegenerator.widget;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.TextView;
import android.widget.Toast;
@briandfoy
briandfoy / github2ohloh.pl
Created July 27, 2012 19:43
Add Github projects to Ohloh
#!/usr/bin/perl
use v5.14;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new->max_redirects(5);
my $user = $ENV{GITHUB_USER} // '...';
my @committer_names = ( '...', '...', );
$ENV{OHLOH_USER} //= '...';
@ekoneil
ekoneil / gist:3178821
Created July 25, 2012 21:30
Calling Facebook APIs with the 3.0 SDK
// #1: Graph API: /me
- (void)requestMe {
[FBRequestConnection startForMeWithCompletionHandler:^(FBRequestConnection *connection,
NSDictionary<FBGraphUser> *me,
NSError *error) {
if(error) {
[self printError:@"Error requesting /me" error:error];
return;
}