Skip to content

Instantly share code, notes, and snippets.

:%s/\v\{'([^']*)'\}/"\1"/
@ryubro
ryubro / How Strapi behaves when content types are changed.md
Last active January 23, 2019 10:57
How Strapi behaves when content types are changed

How Strapi behaves when content types are changed

This is result of a small research on what may happen when two Strapis with slightly different content types share one database. This may happen when we want to deploy Strapi instances with slightly different content types in two different deploy slots.

Environment

  • Strapi 3.0.0-alpha.17
  • using MySQL (version is hardly relevant)

How Strapi behaves when content types are changed, in general

While I was giving feedback to the REST API design of our CMS, I felt like this is a more general issue than a specific case, because I felt the same when I saw how the tasks work in Iris.

I like the general concept of Iris. I cannot agree more about the idea that we should separate the coaching logic and the app logic. But I have to say that some parts of Iris are implemented in poor ways.

Let me be more specific. Our CMS REST API is using POST method for the querying contents. You'll know that we should use GET if you finished the REST API design 101. The way the tasks work is so restricted without any good reason that it couldn't support the Brightr shift properly. I can tell that this is done by who doesn't understand JS.

Excuse me for saying that Umar is not very good at REST API and JS, but that's not a shame at all. Everyone has his own strength. Even Ricky the Everything doesn't know as much as Dwi the Jr. Developer when it comes to JS (CRMIIW, no research is done). Now it looks like that every

function register(username, password, orgSecret) {
return new Promise(resolve => {
setTimeout(() => {
console.log('Registered with a credential:', username, password);
resolve({ username, password });
}, 1000);
});
}
function login({ username, password }) {
@ryubro
ryubro / Starbucks wifi login
Last active April 26, 2019 23:18
스타벅스 wifi 자동 로그인 북마클릿
var frm=document.pageForm;
var firstURL = "http://first.wifi.olleh.com/starbucks/index_en_new.html";
var secondURL = "https://first.wifi.olleh.com/starbucks/starbucks_en.php";
switch(window.location.href) {
case firstURL:
document.getElementById('stCheck').checked = false;
NextPage('0');
break;
case secondURL:
frm.cust_email_addr.value = Math.random().toString(36).replace(/[0-9\.]/g, "").substring(0,Math.floor(Math.random()*10)+2)+"@"+["yahoo.com","hotmail.com"][Math.floor(Math.random()*2)];
@ryubro
ryubro / gist:33f5e76ca49dff122097
Created February 5, 2015 08:21
현재 폴더에서 FTP 서버를 실행해주는 python 코드
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
import os
authorizer = DummyAuthorizer()
path = os.getcwd()
authorizer.add_user("user", "pass", path, perm="elradfmw")
handler = FTPHandler
import requests
import re
import winsound
import time
#브라우저의 개발자 도구에서 리퀘스트 헤더를 확인해서 아래 내용을 수정하세요.
headers = {
'Host': 'ticket.cgv.co.kr',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'Origin': 'http://ticket.cgv.co.kr',