This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+------+----------+-----------------+-----------------+-------------+-------------+----------------------+---------------------+ | |
| id | body | recipientId | recipientType | senderId | status | dateReceived | dateSent | | |
+------+----------+-----------------+-----------------+-------------+-------------+----------------------+---------------------+ | |
| 1 | mEssAgE | 2 | user | 5 | pending | 2016-09-22 20:22:05 | 2016-09-22 20:22:05 | | |
| 2 | test123 | 3 | room | 4 | received | 2016-09-22 20:22:05 | 2016-09-22 20:22:05 | | |
+------+----------+-----------------+-----------------+-------------+-------------+----------------------+---------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getUserById($userId) { | |
$sql = "SELECT users.*, | |
COALESCE((SELECT locations.friendlyAddress | |
FROM locations | |
WHERE locations.userId = users.id | |
ORDER BY locations.dateGather | |
DESC LIMIT 1), 'Unavailable') lastKnownLocation, | |
COALESCE((SELECT CONCAT(locations.latitude, ',', locations.longitude) | |
FROM locations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Http { | |
public: | |
// omitted other code | |
/** | |
* @param callback(CURLcode, response) | |
*/ | |
template<typename F> | |
void request(std::string url, F &callback) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | |
<PreferenceCategory | |
android:title="@string/settings_category_title_server" | |
android:key="@string/settings_key_title_server"> | |
<EditTextPreference | |
android:key="@string/settings_key_server_address" | |
android:summary="@string/settings_summary_server_address" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------- | |
// ---------------- Usage | |
// ---------------- | |
public void newRequest(String memberToken, String accessKey) { | |
OkHttpClient client = defaultHttpClient(); | |
Request request = new Request.Builder() | |
.url(url) | |
.addHeader("accesskey", accessKey) | |
.addHeader("membertoken", memberToken) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static BindableProperty CreateProperty<T>(T defaultValue = default, BindingMode mode = BindingMode.TwoWay, [CallerMemberName] string propertyName = null) | |
{ | |
propertyName = RemoveLastOccurrence(propertyName, "Property"); | |
return BindableProperty.Create(propertyName, typeof(T), typeof(BindableObject), defaultValue, mode); | |
} | |
private static string RemoveLastOccurrence(string source, string toFind) | |
{ | |
var index = source.LastIndexOf(toFind); | |
return index == -1 ? source : source.Substring(0, index); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (string.Empty is object a) | |
{ | |
return; | |
} | |
//a = ""; // uncomment this line to compile | |
switch(a) | |
{ | |
case string b: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BindableProperty\.Create | |
< // begin of template | |
\s*? // optional spaces | |
[a-zA-Z0-9\.]+ // matches letters and numbers including dots | |
, // literal comma | |
\s*? // optional spaces | |
([a-zA-Z0-9\.\?<>]+) // matches letters, numbers, dots, greater/less than signs, question marks - first group | |
> // end of template | |
\s*? // optional spaces | |
\( // begin of function invoke i.e open parenthesis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createPopup(e){var t=document.createElement("div");t.style.width="400px",t.style.height="180px",t.style.padding="40px 18px",t.style.backgroundColor="#555",t.style.color="white",t.style.position="absolute",t.style.left=rand(20,400)+(window.innerWidth/2-200)+"px",t.style.top=rand(20,200)+(window.innerHeight/2-90)+"px",t.style.zIndex="1000",t.style.transition="background-color 6s ease-out",t.className="x-popup";var o=document.createTextNode(e);return t.appendChild(o),t}function rand(e,t){return[-1,1][2*Math.random()|0]*Math.floor(Math.random()*(t-e+1)+e)}!function(){var e=0;setInterval(function(){e++;var t=createPopup("Lorem Ipsum");document.body.appendChild(t),setTimeout(function(){t.style.backgroundColor="rgba(0, 0, 0, 0)"},100),setTimeout(function(){document.body.removeChild(t)},6e3)},1e3)}(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(t,e){var i=document.createElement("canvas");i.id="world",i.style.backgroundColor="transparent",i.style.zIndex="10000",i.style.width=window.innerWidth+"px",i.style.height=window.innerHeight+"px",i.style.position="fixed",i.style.left="0",i.style.top="0",i.style.pointerEvents="none",document.body.appendChild(i);var h=30,s=300,o=3,r=10,n=4e3,a=.5,c=function(t,e){var i,h,s,o,r=null;return function(){if(null!==r)return o=r,r=null,h*o+t;do{i=2*Math.random()-1,h=2*Math.random()-1,s=i*i+h*h}while(s>=1);return r=e*Math.sqrt(-2*Math.log(s)/s),i*r+t}};pointCopy=function(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e},Trail=function(t,e,i){this.pos={x:0,y:0,z:0},this.start={x:0,y:0,z:0},this.goal={x:0,y:0,z:0},this.anchor_1={x:0,y:0,z:0},this.anchor_2={x:0,y:0,z:0},this.start_time=0,this.take_time=1,this.vertexes=[],this.anchors_1=[],this.anchors_2=[],this.color_f=i,pointCopy(t,this.pos),pointCopy(t,this.start),pointCopy(t,this.goal),this.setNextGoal(e)},Trail.prototype.setNextGoal=function(t,e){pointCopy(this.goal,this. |