Skip to content

Instantly share code, notes, and snippets.

View afc163's full-sized avatar
🎃
Closing issues

afc163 afc163

🎃
Closing issues
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@swider
swider / rotate.less
Created October 6, 2011 22:46
LESS Rotate Mixin for IE
.rotate(@val) {
-moz-transform: rotate(@val); /* FF3.5+ */
-o-transform: rotate(@val); /* Opera 10.5 */
-webkit-transform: rotate(@val); /* Saf3.1+, Chrome */
-ms-transform: rotate(@val); /* IE9 */
transform: rotate(@val);
/* IE6-IE8 */
@radians: ~`parseInt("@{val}") * Math.PI * 2 / 360`;
@costheta: ~`Math.cos("@{radians}")`;
@kara-ryli
kara-ryli / MyAppDelegate.m
Created October 20, 2011 22:21
Create a device-specific identifier in Objective-C
@implementation MyAppDelegate
/**
* Generates a Universally Unique Identifier based on the time and
* hardware details of a device. CFUUIDCreate is the recommended
* way by Apple to generate an ID now that UIDevice-uniqueIdentifier
* is deprecated.
*
* Props: http://www.cocoabuilder.com/archive/cocoa/217665-how-to-create-guid.html#217668
*/
@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
@jordelver
jordelver / gist:3073101
Created July 8, 2012 22:06
Set the Mac OS X SOCKS proxy on the command line

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port

@yyx990803
yyx990803 / frameworks.md
Created December 3, 2012 21:52
国内互联网公司的前端框架简介

百度:Tangram

基本上就是个百度版jQuery,2.0版本使用链式API,更像了。
配套的还有UI库Magic和模版引擎BaiduTemplate(和ejs很像)

腾讯:JX

理念在介绍里面写的很详细,代码清晰,注释丰富,可读性很好,但只有文档没有实例。
比较传统的大块头框架,本质上来说还是一堆工具方法和对象的堆积,提供了很基本的模块化的开发方式,但没有模块间的依赖关系支持。

@andreashanft
andreashanft / gist:5116781
Created March 8, 2013 14:29
Handling output of a NSTask
NSTask* task = [[NSTask alloc] init];
{
[task setStandardOutput:[NSPipe pipe]];
[task setStandardError:[NSPipe pipe]];
[task setLaunchPath:...];
[task setArguments:...];
[task setTerminationHandler:^(NSTask* task)
{
if ([task terminationStatus] == 0)
{
@ufologist
ufologist / app.js
Created June 20, 2013 07:51
RequireJS load module mechanism
require(['main'], function(main) {
main.hello();
});
@StuPig
StuPig / parrallax_library_bookmark.markdown
Created September 3, 2013 03:03
视差动画库收集 A collection of parallax scrolling library bookmarks
@creamidea
creamidea / memorize.js
Last active July 14, 2022 15:26
函数式编程当中,缓存技巧叫做「记忆」(memorization),一阶乘函数。
function memorize(f) {
var cache = {};
// 这个函数是什么意思呢
// 就是使用闭包的特性,保留了cache的值
// 这值将间接使用上次调用时产生的值。下面例子中会详细讲解。
return function() {
console.log(cache); // 打印缓存值
// 这里的key就是一个签名档意思,也就是被缓存函数的参数
var key = Array.prototype.join.call(arguments, ',');
// console.log(key)