Skip to content

Instantly share code, notes, and snippets.

View Yokii908's full-sized avatar

Alexis Coquard Yokii908

  • Lognes
View GitHub Profile
@matthewhegarty
matthewhegarty / django-import-export-bulk-import.md
Last active October 15, 2024 18:23
Performance improvements for `django-import-export` bulk import

Performance improvements for bulk import

I implemented for my own use case - not fully tested - use at your own risk

This is how I improved performance of django-import-export when importing a large set of new rows.

  • Thinkpad T470 i5 processor (Ubuntu 18.04)
  • 20,000 new rows to be inserted
  • total import duration 5.4 seconds
@satishgunjal
satishgunjal / wifissid.py
Created October 14, 2018 07:20
Get connected wifi SSID using python on Raspberry pi
import subprocess
try:
output = subprocess.check_output(['sudo', 'iwgetid'])
print("Connected Wifi SSID: " + output.split('"')[1])
except Exception, e:
print e
@kentbrew
kentbrew / lang_chrome_osx.md
Last active August 19, 2024 13:38
How to change the Chrome default language on OSX

How to Change your Chrome Default Language

Open up a Terminal window. (If you have never seen Terminal before, go to Spotlight Search and type "Terminal.")

In the Terminal box, try this:

defaults read com.google.Chrome AppleLanguages

If you see this:

@Epillepsy
Epillepsy / IPCameraView.swift
Last active October 9, 2019 06:25 — forked from jeffmcfadden/IPCameraView.swift
A UIView Subclass For Displaying An IPCamera Stream (MJPEG) for swift 3
import Foundation
import UIKit
//MARK: For Swift 3
class IPCameraView: UIView, URLSessionDataDelegate {
var imageView:UIImageView
var url: URL?
var endMarkerData: NSData
var receivedData: NSMutableData
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active November 11, 2024 17:49
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

// MIT license (c) andelf 2013
import (
"net/smtp"
"errors"
)
type loginAuth struct {
username, password string