Skip to content

Instantly share code, notes, and snippets.

View o0101's full-sized avatar
🏖️
Netscaping

Cris o0101

🏖️
Netscaping
View GitHub Profile
@o0101
o0101 / index.html
Created September 23, 2017 18:15 — forked from anonymous/index.html
Bookmarklet // source https://jsbin.com/nosefuduju
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Bookmarklet</title>
</head>
<body style="max-width:700px; margin:0 auto;">
<p>Here is the bookmarklet:
<a href="javascript:(function()%7B(function()%20%7Bconst%20req%20%3D%20new%20XMLHttpRequest()%3Bconst%20key%20%3D%20'AIzaSyAUYMRSUW3BAZLhSTbB1poQuQ4xaqt2C4c'%3Breq.open('POST'%2C%20'https%3A%2F%2Fwww.googleapis.com%2Furlshortener%2Fv1%2Furl%3Fkey%3D'%2Bkey)%3Breq.setRequestHeader(%22Content-Type%22%2C%20%22application%2Fjson%22)%3Breq.responseType%3D%22json%22%3Breq.send(JSON.stringify(%7BlongUrl%3Alocation.href%7D))%3Bconst%20text%20%3D%20document.createElement('textarea')%3Blet%20result%3BsetTimeout(%20()%20%3D%3E%20(document.execCommand('copy')%2Ctext.remove())%2C%20700%20)%3Breq.onreadystatechange%20%3D%20()%20%3D%3E%20%7Bif%20(%20req.status%20%3D%3D%20200%20%26%26%20req.readyState%20%3D%3D%204%20)%20%7Bdocument.body.appendChild(text)%3Btext.value%20%3D%20req.response.id%3Btext.se
@o0101
o0101 / codegolf.md
Created September 28, 2017 09:48 — forked from xem/codegolf.md
JS code golfing

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)

@o0101
o0101 / readme.md
Created August 16, 2018 13:54 — forked from flbuddymooreiv/readme.md
erlang + rebar + cowboy Hello World

This is the process of setting up erlang, rebar3, and cowboy for a Hello World, starting with a clean Debian 8 install.

Update apt and install deps:

root@046edcaea45a:~# apt-get update
root@046edcaea45a:~# apt-get install erlang erlang-dev gcc
root@046edcaea45a:~# wget https://s3.amazonaws.com/rebar3/rebar3
root@046edcaea45a:~# mkdir ~/bin/
root@046edcaea45a:~# mv rebar3 ~/bin/
root@046edcaea45a:~# chmod +x ~/bin/rebar3 
@o0101
o0101 / pseudo_elements.md
Created September 6, 2018 14:33 — forked from p3t3r67x0/pseudo_elements.md
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@o0101
o0101 / tester.js
Created November 5, 2018 10:32 — forked from freedmand/tester.js
JavaScript unit testing in under 30 lines
const PASS = ['32']; // green
const FAIL = ['31', '1']; // red, bold
function logStyle(ansiEscapeCodes, text) {
console.log(`\x1b[${ansiEscapeCodes.join(';')}m${text}\x1b[0m`);
}
class Tester {
constructor() {}
apt install build-essential pkg-config autoconf libtool unzip gtk+2.0 xserver-xorg libglu1-mesa-dev freeglut3-dev mesa-common-dev libxmu-dev libxi-dev libasound2 libasound2-plugins alsa-utils alsa-oss pulseaudio pulseaudio-utils libpulse-dev chromium-browser
http://us.download.nvidia.com/XFree86/Linux-x86_64/410.93/NVIDIA-Linux-x86_64-410.93.run
nvidia-xconfig --query-gpu-info
sudo nvidia-xconfig --busid=PCI:0:3:0 --use-display-device=none --virtual=1280x1024
nodejs
sudo usermod -aG pulse,pulse-access root
/etc/pulse/default.pa
load-module module-stream-restore restore_device=false
https://gist.github.com/jniltinho/9c009e9771651aa4a004ad3d1f6857e3
https://bitbucket.org/goempirical/bullman/get/bcc1b7ae6eb9.zip
@o0101
o0101 / background.js
Created November 22, 2019 11:43 — forked from muralikg/background.js
puppeteer screen capture demo. Currently records 10 second video. Change the timeout in background.js with your own logic to stop the recording when necessary. Try with `node export.js`
/* global chrome, MediaRecorder, FileReader */
chrome.runtime.onConnect.addListener(port => {
let recorder = null
port.onMessage.addListener(msg => {
console.log(msg);
switch (msg.type) {
case 'REC_STOP':
console.log('Stopping recording')
if (!port.recorderPlaying || !recorder) {
@o0101
o0101 / gist:b52c5a1808548b991c22857e358db61c
Created October 31, 2020 15:09 — forked from kurokikaze/gist:350fe1713591641b3b42
install chrome from powershell
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
@o0101
o0101 / script-template.sh
Created December 15, 2020 12:07 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
trap cleanup SIGINT SIGTERM ERR EXIT
usage() {
cat <<EOF
@o0101
o0101 / sysctl.conf
Created August 14, 2021 06:39 — forked from kgriffs/sysctl.conf
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
#
# See also: https://gist.github.com/kgriffs/4027835
#
# Assumes a beefy machine with lots of network bandwidth