Skip to content

Instantly share code, notes, and snippets.

View Jae-kwang's full-sized avatar
🥤

Jaekwang jung Jae-kwang

🥤
  • Line+ Corp
  • Republic of Korea
View GitHub Profile
@appkr
appkr / result.md
Last active April 16, 2022 06:01
Performance Comparison for Dynamically-typed Non-compile Languages

Test Result

Language Execution time(sec)
JS with V8 (Node 8.11) 3.18
PHP 7.2 28.026075124741
PHP 7.0 28.537676095963
Ruby 2.5 37.355172
Python 2.7 70.2023770809
Python 3.6 99.59470009803772
@hikaMaeng
hikaMaeng / 71_1.json
Created July 6, 2017 06:42
71_1.json
{
"title":"TIOBE Index for June 2017",
"header":["Jun-17","Jun-16","Change","Programming Language","Ratings","Change"],
"items":[
[1,1,"","Java","14.49%","-6.30%"],
[2,2,"","C","6.85%","-5.53%"],
[3,3,"","C++","5.72%","-0.48%"],
[4,4,"","Python","4.33%","0.43%"],
[5,5,"","C#","3.53%","-0.26%"],
[6,9,"","change","Visual Basic .NET","3.11%","0.76%"],
@velopert
velopert / App.js
Last active May 20, 2017 07:45
LifeCycle API 실습
import React, {Component} from 'react';
import ColorBlock from './ColorBlock';
function getRandomColor() {
return '#' + Math.floor(Math.random()*16777215).toString(16);
}
class App extends Component {
constructor(props) {
super(props);
@jesperorb
jesperorb / cors.md
Last active February 21, 2024 14:17
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Access-Control-Allow-Origin
@nathf
nathf / fetch.mock.js
Last active September 13, 2018 09:08
Mock Fetch with Jest
const mockResponse = (status, statusText, response) => {
return new window.Response(response, {
status: status,
statusText: statusText,
headers: {
'Content-type': 'application/json'
}
});
};
@fdidron
fdidron / App.js
Last active April 11, 2023 13:54
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>
@asbubam
asbubam / vim_ctrl_hjkl.kmmacros
Created January 18, 2017 05:43
keyboard maestro ctrl+hjkl to arrow keys
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>506394561.98772597</real>
<key>Macros</key>
@runspired
runspired / form.html
Created May 23, 2016 13:46
How to turn off password and email/username autocomplete.
<!--
<form autocomplete="off"> will turn off autocomplete for the form in most browsers
except for username/email/password fields
-->
<form autocomplete="off">
<!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields -->
<input id="username" style="display:none" type="text" name="fakeusernameremembered">
<input id="password" style="display:none" type="password" name="fakepasswordremembered">
@cbdavide
cbdavide / BinarySearch.js
Last active April 30, 2022 02:18
Binary search algorithm in javascript
var binarySearch = function(array, value) {
var guess,
min = 0,
max = array.length - 1;
while(min <= max){
guess = Math.floor((min + max) /2);
if(array[guess] === value)
return guess;
else if(array[guess] < value)
@maxcnunes
maxcnunes / curl-get-status-code-and-response-body.sh
Created November 24, 2015 17:52
Curl - Get status code and response body
URL="http://stackoverflow.com/"
# store the whole response with the status at the and
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL)
# extract the body
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
# extract the status
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')