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
#include <iostream> | |
using namespace std; | |
char get_first_char(string *str) { | |
return (*str)[1] + 2; | |
} | |
void string_memory(){ | |
long bottom = -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
const parseEs6String = (str: string, ctx: Record<string, string>) => { | |
return new Function(` | |
const proxy = new Proxy(${JSON.stringify(ctx)}, { | |
has() { return true }, | |
get(obj, prop) { | |
if (prop === Symbol.unscopables) return false | |
if (prop in obj) return obj[prop] | |
if (prop in window) return window[prop] | |
return '' | |
} |
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
import koa from 'koa' | |
import middlewareForExpressOrConnect from './path/some-middleware' | |
const app = new koa() | |
app.use(async (ctx, next) => { | |
const { req, res } = ctx | |
return new Promise((resolve, reject) => { | |
middlewareForExpressOrConnect(req, res, (err) => { | |
if (err) { |
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> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover"> | |
<title>Document</title> | |
<style> | |
* { | |
margin: 0; | |
padding: 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
const fs = require('fs') | |
class FakeDatabase { | |
constructor(dbPath) { | |
this._filePath = dbPath || './data.json' | |
this._data = JSON.parse(fs.readFileSync(this._filePath)) | |
this._idBase = Math.max.apply(null, this._data.map(i => i.id)) | |
} | |
_idGen() { |
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> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script src="//shadow.elemecdn.com/zcache/gl/god-dev/[email protected]/dist/perf.min.js"></script> |
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
window.Lib = function(){ | |
var h1 = document.createElement('h1') | |
h1.textContent = 'Hello World' | |
document.body.appendChild(h1) | |
} | |
window.Lib() |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
[Bugtags startWithAppKey:@"APP_KEY" invocationEvent:BTGInvocationEventBubble]; | |
return YES; | |
} |
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([ | |
'jquery' | |
], function ( | |
$ | |
) { | |
var STARTED = false; |
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
window.onload=function(){ | |
var table=document.createElement("table"); | |
for(var i=1;i<10;i++){ | |
var tr=document.createElement("tr"); | |
if(i%2==0){ | |
tr.className="dark"; | |
}else{ | |
} | |
for(var j=1;j<i+1;j++){ | |
var td=document.createElement("td"); |
NewerOlder