What you need to know about JSON in MySQL

What you need to know about JSON in MySQL

Submitted June 01, 2017 at 11:12PM by mcfc_as
via reddit http://ift.tt/2qFjujT


App request: TIL, a twitter like feed with code people learned today

App request: TIL, a twitter like feed with code people learned today

So this app idea, for people that search for a side project, is born out of two things I need.

A place to put things I learned today. For one, so that I dont forget it and can look at it later. For example I learned some time ago, how to setup webpack dev server for https without annoying warnings (with self signed certificate). Or I learned how to setup phpstorm to debug a laravel app. Or what is the best way to set initial data from props in vue. Etc. etc.

So I want to have a place where I can see things I learned at some day. Maybe tagged by topic etc, sorted by date.

But maybe I put so much time in explaining it, I feel like I could share it with others. So then people can see what I learned today. And learn from it.

If they then "retweet", they will kind of say, hey, I also learned this as well today. It will also end up at their feed. But its explained by someone else.

I hope this makes sense. In some way, its like stackoverflow, but then the poster answers his own question, and shares that to the world.

On the other hand its a bit how I use twitter, I follow people that learn me new coding tricks and help me stay up to date with new ideas, new libraries, etc.

Thoughts? Did someone got inspired by this idea for his side project? I wish I had the time, but drowned in other projects 😅

Submitted June 01, 2017 at 11:13PM by kasperpeulen
via reddit http://ift.tt/2ssJtHs

web api coding

web api coding

<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8" /> <link href="../Content/bootstrap.css" rel="stylesheet" /> <link href="../Content/jquery.dataTables.css" rel="stylesheet" /> http://../Scripts/jquery-1.10.2.js http://../Scripts/bootstrap.js http://../Scripts/jquery.dataTables.js http://../AppScripts/Student.js </head> <body>

</form> </div> </div>
Student Course
</div> </div>

</body> </html>

//(function () { var studentTable; $(document).ready(function () { initStudentTable(); getStudents(); getCourse(); $("#btnSave").click(saveStudent); $("#btnClear").click(clearFormData); //$("#btnCreate").click(navigateToCreate); //$("#btnBack").click(navigateToIndex); });

var initStudentTable = function () { studentTable = $("#tblStudent").dataTable({ data: [], columns: [ { "data": "StudentName" }, { "data": "CourseName" }, { "defaultContent": "<button class=\"btn btn-warning\" onclick=\"editStudent(this)\">Edit</button>" }, { "defaultContent": "<button class=\"btn btn-danger\" onclick=\"deleteStudent(this)\">Delete</button>" } ] }); } var getStudents = function () { serverCaller("api/Student/", "GET", "", bindStudentDataTable) } var bindStudentDataTable = function (result) { studentTable.fnClearTable(); studentTable.fnAddData(result); } var getCourse = function () { serverCaller("api/Course/", "GET", "", bindCourseDropDown) } var bindCourseDropDown = function (result) { $.each(result, function (key, value) { $("#drpCourse").append("<option value='" + value.CourseId + "'>" + value.CourseName + "</option>"); }); } var saveStudent = function () { var studentId = $("input[name='StudentId']").val(); var formData = $("#studentForm").serialize() if (studentId === undefined || studentId === "") { serverCaller("api/Student/", "POST", formData, getStudents); } else { serverCaller("api/Student/" + studentId, "put", formData, getStudents); } clearFormData(); return false; } var editStudent = function (e) { var rowData = studentTable.fnGetData($(e).closest("tr")); serverCaller("api/Student/" + rowData.StudentId, "GET", "", mapStudentData); } var mapStudentData = function (result) { $.each(result, function (key, value) { $("#studentForm").find("input[name='" + key + "']").val(value); }); } var deleteStudent = function (e) { var rowData = studentTable.fnGetData($(e).closest("tr")); serverCaller("api/Student/" + rowData.StudentId, "DELETE", "",getStudents); } var navigateToCreate = function () { window.location.replace("../Create.html"); } var navigateToIndex = function () { window.location.replace("../Index.html"); } var serverCaller = function (url, method, param, serverCallback) { $.ajax({ url: url, method: method, data: param }) .done(serverCallback) .fail(errorHandler); } var errorHandler = function () { alert("Error !"); } var clearFormData = function () { $("#studentForm").find("input").val(""); $("#drpCourse").val(1); } 


Submitted June 01, 2017 at 11:21PM by scoobydooX64
via reddit http://ift.tt/2rJkXpo

Stack Magic is Cursing my build.

Stack Magic is Cursing my build.

I'm on windows, and Stack keeps inserting GHC's bin folder before MINGWs bin, which makes my build die because it's using the wrong copy of zlib1.dll.

The only way I have figured to fix this is to launch stack exec mintty, tweak my path in manually in that shell, and then run stack build from inside bash, which magically works (even though it probably shouldn't).

This of course opens up a whole new suite of windows specific issues, including a stack GHCi that doesn't work right with the mintty terminal – because, again, stack decides to pick it's own executable to launch based on it's inscrutable logic that isn't documented anywhere, and launches the windows GHCi instead of the compat ghci .sh file.

Does anyone know if any of this stuff actually configurable, or is this yet another case of "Why you on windowz lol"?

Submitted June 01, 2017 at 10:42PM by IronGremlin
via reddit http://ift.tt/2ruBlsS