Skip to content

Instantly share code, notes, and snippets.

Avatar
😃
😀

Manfred Touron moul

😃
😀
View GitHub Profile
@moul
moul / 1. intro.txt
Last active Jun 29, 2020
Yo! 👋👋
View 1. intro.txt
+ -== ==|
( <*> <*> ||//
| | yo _||/__
| __| \| |||
| +++ \ /
@pizzafox
pizzafox / four.js
Last active Oct 19, 2020
Get the value 4 in Node.js
View four.js
const four = () => process.toString().big().endsWith(String.fromCharCode(18 + ((process.toString().substring(1, 2).charCodeAt(Number.MIN_VALUE)) * 4) - Math.pow(20, 2))).toString().length;
console.log(four()); // 4
const assert = require("assert");
const fourButReadable = () => {
// String that contains an o as the second character
const objectInString = process.toString();
assert.strictEqual(objectInString, "[object process]");
@automaticit
automaticit / hide-quantum-tab-bar.sh
Created Nov 21, 2017
Hide Firefox Quantum tab bar
View hide-quantum-tab-bar.sh
#!/bin/bash
#
# Based upon [[https://superuser.com/questions/1268732/how-to-hide-tab-bar-tabstrip-in-firefox-57-quantum/1268734#1268734][How to hide tab bar (tabstrip) in Firefox 57+ Quantum]] by [[https://superuser.com/users/162466/vasyanovikov][VasyaNovikov]]
# This causes the [[https://support.mozilla.org/en-US/questions/1187186][The Back Button is top right under the Red close button on my Mac]] issue.
# Resolve that by right-clicking the toolbar, then inserting three Flexible Space into the toolbar on the far-left-hand side.
case $( uname ) in
"Linux")
profile_dir=~/.mozilla/firefox/$( ls -tr ~/.mozilla/firefox/ | grep -v profiles.ini | tail -1 )
;;
"Darwin")
@cerisier
cerisier / install-py3-dataproc.sh
Last active Apr 2, 2020
Dataproc initialization action script for installing python3
View install-py3-dataproc.sh
#!/bin/bash
# from https://gist.githubusercontent.com/nehalecky/9258c01fb2077f51545a/raw/789f08141dc681cf1ad5da05455c2cd01d1649e8/install-py3-dataproc.sh
apt-get -y install python3
echo "export PYSPARK_PYTHON=python3" | tee -a /etc/profile.d/spark_config.sh /etc/*bashrc /usr/lib/spark/conf/spark-env.sh
echo "Adding PYTHONHASHSEED=0 to profiles and spark-defaults.conf..."
echo "export PYTHONHASHSEED=0" | tee -a /etc/profile.d/spark_config.sh /etc/*bashrc /usr/lib/spark/conf/spark-env.sh
echo "spark.executorEnv.PYTHONHASHSEED=0" >> /etc/spark/conf/spark-defaults.conf
View gist:1ab7ca6237aaf1074b5418833622391b
[ 464.491849] BUG: unable to handle kernel NULL pointer dereference at 0000000000000009
[ 464.586152] IP: [<ffffffff8101b290>] intel_pmu_lbr_read+0x70/0x480
[ 464.660511] PGD 465196067 PUD 46a823067 PMD 0
[ 464.713979] Oops: 0000 [#1] SMP
[ 464.752720] Modules linked in: kvm_intel kvm fjes irqbypass autofs4
[ 464.828642] CPU: 3 PID: 4012 Comm: dummy Not tainted 4.4.6-std-4 #1
[ 464.903933] Hardware name: Online Labs SR/SR, BIOS 00.00.00.0007 03/04/2016
[ 464.987580] task: ffff88046d27cac0 ti: ffff88046c4c0000 task.ti: ffff88046c4c0000
[ 465.077491] RIP: 0010:[<ffffffff8101b290>] [<ffffffff8101b290>] intel_pmu_lbr_read+0x70/0x480
[ 465.181084] RSP: 0000:ffff88046c4c3c58 EFLAGS: 00010006
@cerisier
cerisier / random.txt
Created Jan 24, 2016
List of words for random entry creative technique
View random.txt
Adult
Aeroplane
Air
Aircraft Carrier
Airforce
Airport
Album
Alphabet
Apple
Arm
@moul
moul / linux distrib builds.md
Last active Jan 15, 2016
linux distrib builds
View linux distrib builds.md
distrib/builder debootstrap qemu-debootstrap multistrap rinse urpmi anaconda chroot + static pm pacstrap kickstart preseed
debian Y Y Y ?
ubuntu Y Y Y ?
fedora Y Y Y ?
centos Y Y Y ?
redhat Y Y Y ?
gentoo
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active Dec 4, 2020
Event-stream based GraphQL subscriptions for real-time updates
View Event-stream based GraphQL subscriptions.md

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@Zillionx
Zillionx / OSX_TCP_options.command
Last active Nov 21, 2017
OSX - Tuning the Network Stack TCP
View OSX_TCP_options.command
## Quick fix for slow internet after update to OSX 10.11 "El Capitan"
## Changes are not permanent, just restart your mac if it doesn't work.
## write config
sudo su -
sysctl -w net.inet.tcp.doautorcvbuf=0
sysctl -w net.inet.tcp.doautosndbuf=0
sysctl -w net.inet.tcp.win_scale_factor=0
# net.inet.tcp.recvspace=1048576
# net.inet.tcp.sendspace=131072
@jpillora
jpillora / nginx-gitlab.conf
Created Aug 21, 2015
Gitlab go get via SSH
View nginx-gitlab.conf
server {
listen {PUBLIC-GITLAB-HTTP-PORT}; #e.g. 80
server_name {PUBLIC-GITLAB-HOST}; #e.g. git.mycompany.com
# add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
location / {
## Hack to implement && - Concat two strings and compare result
if ($args ~* "^go-get=1") {
set $condition goget;
}
You can’t perform that action at this time.