Skip to content

Instantly share code, notes, and snippets.

View jiangyuan's full-sized avatar

jero jiangyuan

  • Tencent
  • shenzhen, china
View GitHub Profile
@yannisxu
yannisxu / proxy.sh
Last active April 24, 2016 10:57
修改 Mac 网络自动代理配置
alias pacon='sudo networksetup -setautoproxyurl Wi-Fi https://yourproxy.pac'
alias pacoff='sudo networksetup -setautoproxyurl Wi-Fi off'
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active December 29, 2023 00:40
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
To enable any of there plugins, go to: `Settings` -> `Plugins`
You'll find plugins in the first page, to get the others press `Browse repositories...` button.
- Apache config (.htaccess) support
- Bootstrap
- Color Ide
- CSS Support
- EditorConfig
- File Watchers
- Git Integration
@xionglun
xionglun / jsconvert.md
Last active December 20, 2015 22:29
Javascript convert __string__ to __number__

convert a string to number at JavaScript.

  1. +
   +'12';     // 12
   typeof +'12'     // number
  
   +'12s';    // NaN
   typeof +'12s';   // number
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@dimsemenov
dimsemenov / get-image-size.js
Last active February 18, 2018 17:34
I was looking for a way to get an image size with JavaScript before it's completely loaded. It's useful, for example, when you want to display it progressively. I've figured out that we can just fire an interval that will run until an image has defined width. Here is how it works:
// detect if naturalWidth property is supported
// getting it is much faster than getComputedStyle()
var supportsNatural = ( "naturalWidth" in (new Image()) ),
imagePath = 'image.jpg',
interval,
hasSize,
onHasSize = function() {
if(hasSize) return;
var naturalWidth = supportsNatural ? img[0].naturalWidth : img.width();
@zhimiaoli
zhimiaoli / markdown.css
Created August 28, 2012 15:11
github的markdown的样式
.markdown-body {
font-size: 14px;
line-height: 1.6;
}
.markdown-body > *:first-child {
margin-top: 0 !important;
}
.markdown-body > *:last-child {
margin-bottom: 0 !important;
}
@millermedeiros
millermedeiros / example.html
Created August 28, 2012 13:52
node.js script to inline static includes
<!DOCTYPE html>
<!-- #include "inc_header.html" title="Example" header="Sample Title" -->
<html>
<head>
<meta charset="utf-8">
<title>Example</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<h1>Sample Title</h1>
@lg0
lg0 / markdown.xml
Created April 10, 2012 19:58
Markdown Syntax Highlighting for Sublime text 2
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: