Skip to content

Instantly share code, notes, and snippets.

View vectorsize's full-sized avatar

Victor Saiz vectorsize

View GitHub Profile
@vectorsize
vectorsize / gun.py
Created December 17, 2020 22:53
one file git based package manager
#!/usr/bin/env python3
import os
import sys
import subprocess
import json
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
@vectorsize
vectorsize / fixed_kernal_task_high_cpu_on_macos.md
Created July 1, 2020 18:15 — forked from ntamvl/fixed_kernal_task_high_cpu_on_macos.md
Fixed the fan running high, kernel task taking up 500% cpu (high cpu) on macOS

Fixed the fan running high, kernel task taking up 500% cpu (high cpu)

Step 1: Disable SIP

Enter recovery mode

  • Shutdown your macbook
  • Press keys: Command + R
  • Press power button
  • Release keys Command + R when see Apple logo appear
  • Open Terminal app on recovery screen, then run below command:
[{"page":1,"pages":16,"per_page":"20","total":304},[{"id":"ABW","iso2Code":"AW","name":"Aruba","region":{"id":"LCN","iso2code":"ZJ","value":"Latin America & Caribbean "},"adminregion":{"id":"","iso2code":"","value":""},"incomeLevel":{"id":"HIC","iso2code":"XD","value":"High income"},"lendingType":{"id":"LNX","iso2code":"XX","value":"Not classified"},"capitalCity":"Oranjestad","longitude":"-70.0167","latitude":"12.5167"},{"id":"AFG","iso2Code":"AF","name":"Afghanistan","region":{"id":"SAS","iso2code":"8S","value":"South Asia"},"adminregion":{"id":"SAS","iso2code":"8S","value":"South Asia"},"incomeLevel":{"id":"LIC","iso2code":"XM","value":"Low income"},"lendingType":{"id":"IDX","iso2code":"XI","value":"IDA"},"capitalCity":"Kabul","longitude":"69.1761","latitude":"34.5228"},{"id":"AFR","iso2Code":"A9","name":"Africa","region":{"id":"NA","iso2code":"NA","value":"Aggregates"},"adminregion":{"id":"","iso2code":"","value":""},"incomeLevel":{"id":"NA","iso2code":"NA","value":"Aggregates"},"lendingType":{"id":"","iso
pepper="~/Library/Application Support/Google/Chrome/PepperFlash"
version=$(ls -t ~/Library/Application\ Support/Google/Chrome/PepperFlash)
open -n -a "Chromium" --args --ppapi-flash-path="$pepper/$version/PepperFlashPlayer.plugin" --ppapi-flash-version=$version
@vectorsize
vectorsize / lQuery.js
Created February 19, 2015 15:43
Lazy-ass jquery ~ esque utility
// adds shorcuts
var addShorcuts = function(el) {
el.on = el.addEventListener;
el.off = el.removeEventListener;
return el;
};
module.exports = function Lquery(sel) {
// get a proper array of the results
@vectorsize
vectorsize / gist:565e243bceddeceeb5f6
Created October 22, 2014 10:42
Oneliner to copy picture, trace it with potrace and open on preview app
pbpaste | convert - bmp:- | potrace - -o - -b pdf | open -a /Applications/Preview.app -f
@vectorsize
vectorsize / graph.json
Last active August 29, 2015 13:57 — forked from mbostock/.block
{"nodes":[{"x":444,"y":275},{"x":378,"y":324},{"x":478,"y":278},{"x":471,"y":256},{"x":382,"y":269},{"x":371,"y":247},{"x":359,"y":276},{"x":364,"y":302},{"x":400,"y":330},{"x":388,"y":298},{"x":524,"y":296},{"x":570,"y":243},{"x":552,"y":159},{"x":502,"y":287},{"x":511,"y":313},{"x":513,"y":265},{"x":602,"y":132},{"x":610,"y":90},{"x":592,"y":91},{"x":575,"y":89},{"x":607,"y":73},{"x":591,"y":68},{"x":574,"y":73},{"x":589,"y":149},{"x":620,"y":205},{"x":621,"y":230},{"x":589,"y":234},{"x":602,"y":223},{"x":548,"y":188},{"x":532,"y":196},{"x":548,"y":114},{"x":575,"y":174},{"x":497,"y":250},{"x":576,"y":196},{"x":504,"y":201},{"x":494,"y":186},{"x":482,"y":199},{"x":505,"y":219},{"x":486,"y":216},{"x":590,"y":306},{"x":677,"y":169},{"x":657,"y":258},{"x":667,"y":205},{"x":552,"y":227},{"x":518,"y":173},{"x":473,"y":125},{"x":796,"y":260},{"x":731,"y":272},{"x":642,"y":288},{"x":576,"y":269},{"x":605,"y":187},{"x":559,"y":289},{"x":544,"y":356},{"x":505,"y":365},{"x":579,"y":289},{"x":619,"y":282},{"x":574,"y"
@vectorsize
vectorsize / domino.js
Last active June 13, 2019 04:18
D3 in a virtual DOM proof of concept.
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.domino=e():"undefined"!=typeof global?global.domino=e():"undefined"!=typeof self&&(self.domino=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var parserlib = require('./cssparser');
module.exports = CSSStyleDeclaration;
function CSSStyleDeclaration(elt) {
this._element = elt;
}
// Utility function for parsing style declarations
@vectorsize
vectorsize / README.md
Last active December 31, 2015 18:22 — forked from mbostock/.block
DOM-to-Canvas using D3

Mouseover to draw circles!

This is a quick proof-of-concept example demonstrating how to create a canvas scenegraph in the DOM using document fragments. The scenegraph in this example consists of a simple container svg element and a number of child circle elements.

The content positions and sizes are calculated offline and the actual DOM tree doesn't even need to be aware of out svg. To render them, we use a timer that iterates over the child elements and draws them to a canvas element.

This is a modification of the original DOM-to-Canvas using D3 proof of conncept.

{
"caption": "Terminal",
"id": "side-bar-files-open-with-terminal",
"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "Terminal.app"
}
}