Skip to content

Instantly share code, notes, and snippets.

@zhuixinjian
zhuixinjian / delay.js
Created June 30, 2020 07:00 — forked from eteeselink/delay.js
ES7 async/await version of setTimeout
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
async function something() {
console.log("this might take some time....");
await delay(5000);
console.log("done!")
}
something();
http://sugg.search.yahoo.net/sg/?output=jsonp&nresults=10&command=django
http://sugg.search.yahoo.net/sg/?output=json&nresults=10&command=django
http://sugg.search.yahoo.net/sg/?output=xml&nresults=10&command=django
@zhuixinjian
zhuixinjian / meta-tags.md
Last active September 11, 2015 08:37 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@zhuixinjian
zhuixinjian / gist:99591cabe8f4aa0610a9
Last active August 29, 2015 14:07 — forked from ov3rk1ll/gist:467db75bd559f7f97f9e
让当前view一直处于栈顶.
package com.handheldgroup.fullfocus;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import java.lang.reflect.Method;
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
1.CentOS 6.3
#yum install make gcc
#cd /opt
$wget http://redis.googlecode.com/files/redis-2.x.xx.tar.gz
$tar zxf redis-2.x.xx.tar.gz
$cd redis-2.x.xx
$make
$make install
//////
#import <QuartzCore/QuartzCore.h>
UIView *shadowView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, screenWidth)];
shadowView.layer.shadowColor = [UIColor blackColor].CGColor;
shadowView.layer.shadowOpacity = 0.5;
shadowView.layer.shadowOffset = CGSizeMake(0, 2);
shadowView.layer.shadowPath = [UIBezierPath bezierPathWithRect:shadowView.frame].CGPath;
shadowView.layer.shadowRadius = 2.0f;
shadowView.layer.masksToBounds = NO;
[self.view addSubview:shadowView];