Skip to content

Instantly share code, notes, and snippets.

View firedfox's full-sized avatar
🎯
Focusing

Daniel Wang firedfox

🎯
Focusing
  • Weimob
  • Shanghai, China
  • 18:33 (UTC +08:00)
View GitHub Profile
@b0gdanw
b0gdanw / DisableBigSur.sh
Last active March 29, 2024 09:50
Disable Big Sur services
#!/bin/zsh
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
#Disabling unwanted services on macOS 11 Big Sur (11) and macOS Monterey (12)
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist
# user
TODISABLE=()
@otakustay
otakustay / .jshintrc
Created July 17, 2014 05:27
.jshintrc
{
"immed": true,
"latedef": false,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"plusplus": false,
"quotmark": "single",
"regexp": false,
@marcelduran
marcelduran / cpuusage.js
Last active December 18, 2015 05:38
Getting CPU(s) usage % with NodeJS,based on: https://github.com/oscmejia/os-utils/blob/master/lib/osutils.js
var os = require('os');
const RESOLUTION = 1000; // 1s CPU resolution
function cpusInfo() {
return os.cpus().map(function(cpu) {
var t = cpu.times;
return {
total: t.user + t.nice + t.sys + t.irq + t.idle,
@robmiller
robmiller / .vimrc
Last active February 18, 2022 11:53
Autoload sessions created by tpope's vim-obsession when starting Vim.
augroup sourcesession
autocmd!
autocmd VimEnter * nested
\ if !argc() && empty(v:this_session) && filereadable('Session.vim') |
\ source Session.vim |
\ endif
augroup END
@jamesrampton
jamesrampton / open_without.sh
Last active October 8, 2019 21:16
Clean up Mac OS X Open With menu
#!/bin/bash
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
killall Finder
function getSomeThings(callback) {
var completed = 0;
var people, tasks;
$.ajax('/data/people.json', {
dataType: 'json',
success: function(data) {
completed++;
people = data.people;
onFinished();
@adammw
adammw / README.md
Created August 3, 2012 06:30
Node.js for Raspberry Pi

Node.js for Raspberry Pi

Pre-built binaries

Recent releases have been pre-built using cross-compilers and this script and are downloadable below.

If you have found these packages useful, give me a shout out on twitter: @adammw

@Gozala
Gozala / example.js
Created January 29, 2012 03:46
Workaround for lack of "tail call optimization" in JS
// Lack of tail call optimization in JS
var sum = function(x, y) {
return y > 0 ? sum(x + 1, y - 1) :
y < 0 ? sum(x - 1, y + 1) :
x
}
sum(20, 100000) // => RangeError: Maximum call stack size exceeded
// Using workaround
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@defunkt
defunkt / browser
Created March 1, 2010 10:01
pipe html to a browser
#!/bin/sh -e
#
# Usage: browser
# pipe html to a browser
# e.g.
# $ echo '<h1>hi mom!</h1>' | browser
# $ ron -5 man/rip.5.ron | browser
if [ -t 0 ]; then
if [ -n "$1" ]; then