Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 24, 2024 17:56
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@wrburgess
wrburgess / gist:5528649
Last active November 24, 2022 15:29
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

@victorono
victorono / chromecast.sh
Created March 27, 2014 00:48
Using Google Chromecast from Fedora 20
cat /proc/sys/net/ipv4/ip_local_port_range
firewall-cmd --permanent --add-port=32768-61000/udp
firewall-cmd --reload
firewall-cmd --permanent --zone=home --add-port=32768-61000/udp
iptables -A INPUT -s 192.168.0.0/24 -p udp -m udp --dport 32768:61000 -j ACCEPT
@bcoe
bcoe / npm-top.md
Last active June 16, 2024 08:40
npm-top.md

npm Users By Downloads (git.io/npm-top)


npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.

Metrics are calculated using top-npm-users.

# User Downloads
@Lh4cKg
Lh4cKg / teamviewer
Last active May 10, 2021 13:41
Howto Fix TeamViewer Daemon is not running | start teamviewerd on Fedora 24
[innotec@innotec ~]$ locate teamviewerd
/etc/init/teamviewerd.conf
/opt/teamviewer8/logfiles/install_teamviewerd.log
/opt/teamviewer8/tv_bin/teamviewerd
/opt/teamviewer8/tv_bin/script/teamviewerd.conf
/opt/teamviewer8/tv_bin/script/teamviewerd.service
/opt/teamviewer8/tv_bin/script/teamviewerd.sysv
/opt/teamviewer8/tv_bin/script/teamviewerdMint.conf
[innotec@innotec ~]$ sudo /opt/teamviewer/tv_bin/teamviewerd start
[innotec@innotec ~]$ teamviewer
@DimitryDushkin
DimitryDushkin / react-router-queyry-utils.js
Last active March 5, 2021 13:38
React router utility functions to add and remove queries
import { browserHistory } from 'react-router';
/**
* @param {Object} query
*/
export const addQuery = (query) => {
const location = Object.assign({}, browserHistory.getCurrentLocation());
Object.assign(location.query, query);
browserHistory.push(location);
};
@bvaughn
bvaughn / eager-prefetching-async-data-example.js
Last active June 16, 2024 21:56
Advanced example for eagerly prefetching async data in a React component.
// This is an advanced example! It is not intended for use in application code.
// Libraries like Relay may make use of this technique to save some time on low-end mobile devices.
// Most components should just initiate async requests in componentDidMount.
class ExampleComponent extends React.Component {
_hasUnmounted = false;
state = {
externalData: null,
};
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 23, 2024 00:25
set -e, -u, -o, -x pipefail explanation
@vinicius73
vinicius73 / Dockerfile
Last active August 15, 2019 22:21
Node project with PM2 and Docker
FROM node:10.15-alpine as base
RUN apk --no-cache --virtual build-dependencies add \
python \
make \
g++ \
&& rm -f /var/cache/apk/* \
&& npm config set unsafe-perm true \
&& npm install --quiet node-gyp -g --cache /tmp/empty-cache
@keatz55
keatz55 / index.ex
Last active April 12, 2021 17:49
LiveView Query Helper Module
defmodule ExampleWeb.ArticleLive.Index do
alias Example.{Articles, Tags}
alias ExampleWeb.{ArticleLive, ComponentLive, Query}
use ExampleWeb, :live_view
@impl true
def render(assigns) do
~L"""
<div class="container max-w-screen-md mx-auto pt-6">