Skip to content

Instantly share code, notes, and snippets.

View iShawnWang's full-sized avatar
🤗
2333

Shawn Wang iShawnWang

🤗
2333
View GitHub Profile
@thoop
thoop / nginx.conf
Last active December 8, 2023 21:55
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@cyrus-and
cyrus-and / this.js
Last active July 9, 2019 11:50
JavaScript `this` examples from http://stackoverflow.com/a/12371105/477168
// JavaScript `this` examples from http://stackoverflow.com/a/12371105/477168
// The value of this in a function is sometimes called the "context" in which
// the function runs. The most important thing to understand is that a function
// object does not have a fixed context -- the value of this changes depending
// on how the function is called.
// If the function is called as a "raw" function (e.g., just do someFunc()),
// this will be window (or undefined if the function runs in strict mode).
@stormpython
stormpython / how_to_set_up_ssh_keys.md
Last active August 10, 2023 03:33
Setting up ssh keys for remote server access

How to Set up SSH Keys

Create the RSA Key Pair

ssh-keygen -t rsa

Store the Keys and Passphrase

Once you have entered the Gen Key command, you will get a few more questions:

@lvdaqian
lvdaqian / jenkins-email-ext-clangScanReport-template.jelly
Created April 10, 2014 07:00
a jelly script template for jenkins email-ext plugin. in this template we can publish the report of clangScanBuild plugin by using email template.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<html>
<head>
<title>${project.name}</title>
<style>
body table, td, th, p, h1, h2 {
margin:0;
font:normal normal
100% Georgia, Serif;
background-color: #ffffff;
@raddeus
raddeus / app.js
Last active May 24, 2023 15:41
Basic Express 4.0 Setup with connect-flash
var express = require('express');
var session = require('express-session');
var cookieParser = require('cookie-parser');
var flash = require('connect-flash');
var app = express();
app.use(cookieParser('secret'));
app.use(session({cookie: { maxAge: 60000 }}));
app.use(flash());
@patrickhammond
patrickhammond / android_instructions.md
Last active March 29, 2024 20:14
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@jcouyang
jcouyang / 3-reason-to-use-jest-to-test-your-javascript.md
Last active March 24, 2019 13:58
用 jest 轻松测试 JavaScript

Javascript 的测试, 不管在用 jasmine 还是 mocha, 都是很头疼的事情. 但是自从有了 jest, 一口气写7个测试, 腰也不疼了, 头也不疼了.

只需要 3 个理由

在说用 jest 测为什么好之前,我们先来看我们要测的一个例子.

@wudi
wudi / new_gist_file_0
Created October 11, 2014 07:51
iOS程序字体与ps设计字体换算
一,ps和pt转换px:相对长度单位。像素(Pixel)。(PS字体)
pt:绝对长度单位。点(Point)。(iOS字体)公式如下:pt=(px/96)*72。二,字体间转换1in = 2.54cm = 25.4 mm = 72pt = 6pc
具体换算是:
Points Pixels Ems Percent
6pt 8px 0.5em 50%
7pt 9px 0.55em 55%
7.5pt 10px 0.625em 62.5%
8pt 11px 0.7em 70%
9pt 12px 0.75em 75%
10pt 13px 0.8em 80%