Skip to content

Instantly share code, notes, and snippets.

@jalogut
jalogut / docker_space_cheat_sheet.md
Last active May 1, 2024 21:21
Cheat sheet to check disk usage on docker. Identify what takes most of your space

Total disk size configuration (Mac)

ls -klsh ~/Library/Containers/com.docker.docker/Data/vms/0/Docker.raw

Total disk usage (Mac)

du -h ~/Library/Containers/com.docker.docker/Data/vms/0/Docker.raw
@zhuowei
zhuowei / reachable_services.txt
Created February 21, 2023 06:26
Reachable Mach services from the app sandbox on iOS 16.1
PurpleSystemAppPort
PurpleSystemEventPort
UIASTNotificationCenter
com.apple.ABDatabaseDoctor
com.apple.AppSSO.service-xpc
com.apple.AuthenticationServicesCore.AuthenticationServicesAgent
com.apple.CARenderServer
com.apple.ClipServices.clipserviced
com.apple.CoreAuthentication.daemon
com.apple.DeviceAccess.xpc

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@marc-x-andre
marc-x-andre / event_emitter.py
Created June 26, 2020 21:23
A event emitter in Python
from typing import Dict
class EventEmitter:
def __init__(self):
self._callbacks: Dict[str, callable] = {}
def on(self, event_name, function):
self._callbacks[event_name] = self._callbacks.get(event_name, []) + [function]
@dgeibi
dgeibi / normal.js
Last active May 1, 2024 21:16
[ES6 Class]
class Point {
set X(v) {
this.x = v;
}
get X() {
return this.x;
}
getX() {
console.log(this.X);
}
@wuchengwei
wuchengwei / NodeJS - Http Post.js
Created December 26, 2011 08:34
NodeJS - Http Post
//doHttpPost('localhost', 8000, '/TestPost', 'string' , 'TestTestTestTest', false);
//doHttpPost('localhost', 8000, '/TestPost', 'file' , '/Users/chengwei/Downloads/grid1.png', true);
function doHttpPost(_host, _port, _path, name, value, isFile, fileEncoding) {
var http = require('http'),
fs = require('fs'),
path = require('path'),
boundary = Math.random(),
postData, postOptions, postRequest;
{
"require": {
"slim/slim": "2.*",
"illuminate/database": "*",
"dhorrigan/capsule": "*"
}
}
@fta2012
fta2012 / DragTransform
Last active May 1, 2024 21:15
Slightly modified compiled coffeescript from this codepen: http://codepen.io/fta/pen/ifnqH. Paste into console on a page that has jQuery to load the two dependent libraries (jquery-ui and numericjs). Then call makeTransformable('#selector-name') to make that element WYSIWYG editable. Use inspector to get the CSS for the transforms.
var selector = 'img' // Replace this with the selector for the element you want to make transformable
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() {
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() {
(function() {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;
@nkbt
nkbt / .eslintrc.js
Last active May 1, 2024 21:15
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {