Skip to content

Instantly share code, notes, and snippets.

View pocojang's full-sized avatar
๐Ÿข

Poco pocojang

๐Ÿข
View GitHub Profile
@DenisIzmaylov
DenisIzmaylov / i18n-data.json
Last active May 3, 2021 21:12
Easy i18n translation in your ES6 apps
{
"ru": {
"Your original english text": "ะขะฒะพะน ะพั€ะธะณะธะฝะฐะปัŒะฝั‹ะน ั€ัƒััะบะธะน ั‚ะตะบัั‚"
}
}

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@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
@woowawebui
woowawebui / s70_1_0.js
Created May 10, 2017 12:23
๊ตฌ๊ตฌ๋‹จ
for (var i = 1; i <= 9; i++) {
for (var j = 1; j <= 9; j++) {
console.log(i, 'X', j, '=', i * j);
}
}
eachDan(7);
for (var i = 8; i <= 18; i += 2) eachDan(i);
printDan([3, 7, 9, 13]);
var tasks = [];
var STATE_P = '์ง„ํ–‰';
var STATE_C = '์™„๋ฃŒ';
var addTask = (function() {
var id = 0;
return function(title) {
tasks.push({
anonymous
anonymous / S70 To-Do 02
Created June 2, 2017 07:58
var todo = (function(){
var tasks = [];
var STATE_P = '์ง„ํ–‰';
var STATE_C = '์™„๋ฃŒ';
var addTask = (function(){
var id = 0;
return function(title){
var todo = (function(){
var tasks = [];
var STATE_P = '์ง„ํ–‰';
var STATE_C = '์™„๋ฃŒ';
var addTask = (function(){
var id = 0;
return function(title){
var result = id;
var todo = (function(){
var tasks = [];
var STATE_P = '์ง„ํ–‰';
var STATE_C = '์™„๋ฃŒ';
var mode = 'html';
var addTask = (function(){
var id = 0;
@jonathan-fulton
jonathan-fulton / build-url.js
Last active May 14, 2018 00:59
build-url: the bad way
function buildUrl(url, options) {
var queryString = [];
var key;
var builtUrl;
if (url === null) {
builtUrl = '';
} else if (typeof(url) === 'object') {
builtUrl = '';
options = url;
@jonathan-fulton
jonathan-fulton / build-url.js
Created June 15, 2017 16:48
build-url: the good way
function buildUrl(url, options) {
const baseUrl = _getBaseUrl(url);
const opts = _getOptions(url, options);
if (!opts) {
return baseUrl;
}
urlWithPath = _appendPath(baseUrl, opts.path);
urlWithPathAndQueryParams = _appendQueryParams(urlWithPath, opts.queryParams)