Skip to content

Instantly share code, notes, and snippets.

View michaelBenin's full-sized avatar
🏠
Remote

Michael Benin michaelBenin

🏠
Remote
View GitHub Profile
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active May 15, 2024 05:11
To install Github Desktop for Ubuntu

IMPORTANT

See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)

For the sake of "maintaining the tradition" here is the updated version.

@leisurelicht
leisurelicht / workbook.md
Last active February 13, 2024 16:53
Export queryset to Excel workbook
from django.http import HttpResponse
from .utils import queryset_to_workbook

def download_workbook(request):
    queryset = User.objects.all()
    columns = (
        'first_name',
        'last_name',
        'email',
@BasPH
BasPH / black_selection.sh
Created December 11, 2018 19:53
Black on selection
#!/usr/bin/env bash
set -x
black=$1
input_file=$2
start_line=$3
end_line=$4
# Read selected lines and write to tmpfile
@glamrock
glamrock / data_brokers.txt
Created December 5, 2016 20:40
A simply complicated guide to removing your info from data brokers
I've compiled a list of data
aggregators, data brokers, direct marketing firms, and others who trade
personal data. Many of these are very quickly dealt with via web forms,
but others require a letter and a copy of a photo ID. Many of the data
brokers came from my notes, but others have come from Reddit threads,
and stopdatamining.me. All sources were fairly out of date, so I've gone
through and listed the current contact info and process for each. Feel
free to pass it along and let me know if there are any errors or
omissions. ^_^
@acdlite
acdlite / app.js
Last active January 20, 2023 08:23
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@alces
alces / ansible_local_playbooks.md
Last active April 5, 2024 18:28
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@IamAdiSri
IamAdiSri / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Last active May 9, 2022 22:08 — forked from evansneath/Python3 Virtualenv Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py
$ cd <download location>
$ sudo -H python ./get-pip.py
Installing pip also installs Python3
To run Python3
$ python3
Install pip3 by just executing the same file as in the step above, but this time using Python3
$ sudo -H python3 ./get-pip.py
@bevacqua
bevacqua / books.md
Last active October 13, 2018 16:52
Books I plan on buying this week

Web Performance

  • High Performance Web Sites: Essential Knowledge for Front-End Engineers
  • High Performance JavaScript (Build Faster Web Application Interfaces)
  • Even Faster Web Sites: Performance Best Practices for Web Developers
  • Designing for Performance: Weighing Aesthetics and Speed

Web Design

  • Adaptive Web Design: Crafting Rich Experiences with Progressive Enhancement (2nd Edition) (Voices That Matter)
@brock
brock / psql-with-gzip-cheatsheet.sh
Last active May 13, 2024 13:31
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
import React from "react";
import ExecutionEnvironment from "react/lib/ExecutionEnvironment";
React.createClass({
componentWillMount() {
if (ExecutionEnvironment.canUseDOM) {
// ... has dom ..
} else {
//Server side rendering
}