Skip to content

Instantly share code, notes, and snippets.

View interjc's full-sized avatar
😂
Learning

Justin Chen interjc

😂
Learning
View GitHub Profile
@raptium
raptium / gist:2848464
Created June 1, 2012 03:28
敏感词列表
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@VictorTaelin
VictorTaelin / gpt4_abbreviations.md
Last active March 26, 2024 22:49
Notes on the GPT-4 abbreviations tweet

Notes on this tweet.

  • The screenshots were taken on different sessions.

  • The entire sessions are included on the screenshots.

  • I lost the original prompts, so I had to reconstruct them, and still managed to reproduce.

  • The "compressed" version is actually longer! Emojis and abbreviations use more tokens than common words.

// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@typehorror
typehorror / crawler.md
Last active February 19, 2024 03:06
Simple Website Crawler (in python)

Simple Website Crawler

The following gist is an extract of the article Building a simple crawler. It allows crawling from a URL and for a given number of bounce.

Basic Usage

from crawler import Crawler
crawler = Crawler()
crawler.crawl('http://techcrunch.com/')

displays the urls

@alyssaq
alyssaq / gulpfile.js
Last active February 13, 2024 07:55
browserify, babel, gulp, glob, vinyl-source-stream, uglify
/*
npm install gulp gulp-load-plugins gulp-uglify
npm install browserify babelify glob vinyl-source-stream vinyl-buffer
More examples: https://github.com/gulpjs/gulp/tree/master/docs/recipes
*/
var gulp = require('gulp')
var $ = require('gulp-load-plugins')()
var browserify = require('browserify')
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@bitzip
bitzip / .eshintrc
Created September 5, 2015 15:43
个人偏好的eslint配置,带中文注释
# 建议:官方文档对每个规则有简单易懂的例子说明,有时间的同学可以查阅一遍。
# 官方文档 http://eslint.org/docs/rules/
extends: 'eslint:recommended'
# 规则按照首字母在字母表升序排序
rules:
# 单行代码块大括号后需要一个空格
block-spacing: 2
@jeffijoe
jeffijoe / app.js
Last active September 1, 2023 07:34
Streaming uploads through Koa.
import Koa from 'koa'
import parse from './busboy'
import AWS from 'aws-sdk'
const app = new Koa()
const s3 = new AWS.S3({
params: { Bucket: 'myBucket' }
})
@akoepcke
akoepcke / gitmoji-cheatsheet.md
Created February 23, 2020 16:16 — forked from guillermocalvo/gitmoji-cheatsheet.md
Gitmoji Cheatsheet

Gitmoji Cheatsheet

Repository

  • 🎉 Initial commit
  • ⏪ Reverting changes
  • 🔀 Merging branches
  • 🙈 Adding or updating a .gitignore file