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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
#define TimeZone [[NSTimeZone localTimeZone] name] | |
#define IS_IPHONE_6_PLUS ([[UIScreen mainScreen] respondsToSelector:@selector(nativeScale)] && [UIScreen mainScreen].nativeScale > 2.1) | |
#define IS_IPHONE_4 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)480) < DBL_EPSILON) | |
#define IS_IPHONE_5 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)568) < DBL_EPSILON) | |
#define IS_IPHONE_6 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)667) < DBL_EPSILON) | |
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES) | |
#define IS_OS_5_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0) | |
#define IS_OS_6_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) |
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
select * from orders | |
select * from orders ORDER BY id DESC |
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
<system.webServer> | |
<httpProtocol> | |
<customHeaders> | |
<!-- Adding the following custom HttpHeader will help prevent CORS from stopping the Request--> | |
<add name="Access-Control-Allow-Origin" value="*" /> | |
</customHeaders> | |
</httpProtocol> | |
</system.webServer> |
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 String ConvertImageURLToBase64(String url) | |
{ | |
StringBuilder _sb = new StringBuilder(); | |
Byte[] _byte = this.GetImage(url); | |
_sb.Append(Convert.ToBase64String(_byte, 0, _byte.Length)); | |
return _sb.ToString(); | |
} |
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
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
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
SELECT SUSER_NAME() | |
create schema dbo authorization appointmenthouseUser; | |
create schema my_schema_name authorization my_user; | |
alter user appointmenthouseUser with default_schema= dbo; |
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
UPDATE dbo.timezone SET dbo.timezone.[Column 4] = REPLACE( dbo.timezone.[Column 4], RIGHT(dbo.timezone.[Column 4], 1), '' ) |
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
CREATE FUNCTION [dbo].[UNIX_TIMESTAMP] ( | |
@ctimestamp datetime | |
) | |
RETURNS integer | |
AS | |
BEGIN | |
/* Function body */ | |
declare @return integer | |
SELECT @return = DATEDIFF(SECOND,{d '1970-01-01'}, @ctimestamp) |
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
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. | |
catch (DbEntityValidationException ex) | |
{ | |
foreach (var validationErrors in ex.EntityValidationErrors) | |
{ | |
foreach (var validationError in validationErrors.ValidationErrors) | |
{ | |
Trace.TraceInformation("Property: {0} Error: {1}", | |
validationError.PropertyName, |
OlderNewer