Skip to content

Instantly share code, notes, and snippets.

@HintikkaKimmo
HintikkaKimmo / who_data.py
Created February 21, 2017 06:10
handy way to read csv files with unknown csv dialect
import csv
import pprint
# opens csv file and assingns it to an object
with open('data-text.csv') as csvfile:
# Use Sniffer to figure out csv dialect
dialect = csv.Sniffer().sniff(csvfile.read(1024))
csvfile.seek(0)
# pass the dialect to filereader to read the file
reader = csv.reader(csvfile, dialect)
@george-hawkins
george-hawkins / arm64.md
Last active December 5, 2024 08:41
Running virtualized x86_64 and emulated arm64 Ubuntu cloud images using QEMU

QEMU arm64 cloud server emulation

This is basically a rehash of an original post on CNXSoft - all credit (particularly for the Virtio device arguments used below) belongs to the author of that piece.

Download the latest uefi1.img image. E.g. ubuntu-16.04-server-cloudimg-arm64-uefi1.img from https://cloud-images.ubuntu.com/releases/16.04/release/

Download the UEFI firmware image QEMU_EFI.fd from https://releases.linaro.org/components/kernel/uefi-linaro/latest/release/qemu64/

Determine your current username and get your current ssh public key:

@Dan1el42
Dan1el42 / gist:e0bc84883902e0fb4fbf8a5bf8dfcdd7
Created September 1, 2016 07:37
PowerShell: Disable SSL certificate validation
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
1. install openjdk
`sudo apt-get install openjdk-7-jdk`
2. install `android sdk`
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
@havvg
havvg / Firewall.js
Last active April 15, 2025 23:12
ExtJS 6: JSON Web Token API Login with Promises
Ext.define('App.security.Firewall', {
singleton: true,
requires: [
'App.security.TokenStorage'
],
isLoggedIn: function() {
return null !== App.security.TokenStorage.retrieve();
},
@Jiezhi
Jiezhi / ndk_c_call_java_method
Created May 28, 2015 08:25
how c/c++ call java method in android by jni
#include "com_jiezhi_jnitest_MainActivity.h"
jclass mClass;
jobject mObject;
jmethodID mStaticmethodID, mnotStaticMethodID;
/*
* Class: com_jiezhi_jnitest_MainActivity
* Method: nativeInit
* Signature: ()V