Skip to content

Instantly share code, notes, and snippets.

View omidraha's full-sized avatar
🦋
♥‿♥

Omid Raha omidraha

🦋
♥‿♥
View GitHub Profile
@spiritinlife
spiritinlife / easy_localization_keys_extractor.dart
Last active January 20, 2022 11:09
Extract language keys from your source code and merge them into existing translations.
/// This is inspired by intl_translation extract command https://github.com/dart-lang/intl_translation/blob/8a5e883d7fe07b0244adbaf3489ceb3b08385483/bin/extract_to_arb.dart
/// and is a slimed down rough version of it. Most of the code is from this package which is an excellent learning resource for anyone who wants
/// to play around with the dart analyzer.
/// This is a rough script, to extract localization keys for the easy_localization library. It will analyze the souce
/// code and find occurrences of tr and plural ( you could add other method names e.g. gender etc ) and extract the argument at index $argumentIndex
/// which should be the translation key. It then merges those keys to your current translated keys and spits the merged version where the
/// untranslated keys have a value of "MISSING".
/// Known issues
/// tr( isSomething ? "true_key" : "false_key", context ) -> will get this as key isSomething ? "true_key" : "false_key"
@johnhw
johnhw / umap_sparse.py
Last active January 6, 2024 16:09
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random

CockroachDB + Django ORM

cockroachdb/sqlalchemy-cockroachdb#14

TODO

  1. fork django/contrib/postgres driver
  2. patch blocking postgres compatibility issues
  3. review with cockroachdb team to see if any issues can be fixed by cockroach
  4. review with django team
  5. merge adapter as separate cockroachdb adapter
  6. write docs, any admin work, etc.
@GLMeece
GLMeece / how_to_execute_robot_framework_tests.md
Last active October 3, 2022 10:00
How to Run Robot Framework Tests

About

This is a quick "how to run" if you already have everything Robot Framework-related installed. This Gist might be especially handy for those you either just starting out, or if you've inherited a code-base from someone else.

The following assumes you have a terminal (CMD or PowerShell on Windows, Terminal on Mac or Linux) and aren't afraid to use it.

Testing ALL THE THINGS

Test All the Things

  1. cd into the root directory of the Robot Framework files and test cases; we'll assume all test cases are somewhere within a directory named test_cases.
@aaltat
aaltat / foobar.py
Created January 11, 2017 17:00
Register browser in Selenium2Library
from selenium import webdriver
from robot.libraries.BuiltIn import BuiltIn
def open_my_browser(url):
# Code here to open browser your my way
driver = webdriver.Chrome()
# Code here to open browser my way ends
driver.get(url)
s2l = BuiltIn().get_library_instance('Selenium2Library')
@nrollr
nrollr / nginx.conf
Last active April 16, 2024 10:06
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@Arinerron
Arinerron / permissions.txt
Last active March 27, 2024 04:59
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
@borgfriend
borgfriend / maya2017install.sh
Last active April 13, 2024 13:34
Maya 2017 Installation on Ubuntu 16.04
#!/bin/bash
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then
echo Please run this script using sudo
echo Just type “sudo !!”
exit
fi
#Check for 64-bit arch
if [uname -m != x86_64]; then
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of