Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

alincmt ClimenteA

🎯
Focusing
View GitHub Profile
@eldadfux
eldadfux / install.sh
Last active Jan 30, 2021
Installation of Appwrite server
View install.sh
mkdir appwrite-ce && \
cd appwrite-ce && \
curl -o docker-compose.yml https://appwrite.io/docker-compose.yml?port=80 && \
docker-compose up -d --remove-orphans
@ur0n2
ur0n2 / clip.py
Created May 10, 2017
Clipboard copy & paste with python
View clip.py
import sys
import ctypes
OpenClipboard = ctypes.windll.user32.OpenClipboard
EmptyClipboard = ctypes.windll.user32.EmptyClipboard
GetClipboardData = ctypes.windll.user32.GetClipboardData
SetClipboardData = ctypes.windll.user32.SetClipboardData
CloseClipboard = ctypes.windll.user32.CloseClipboard
CF_UNICODETEXT = 13
View Django and Python 3 in Amazon Lightsail
sudo apt-get update
sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx
sudo -u postgres psql
- paste this code in postgres console:
CREATE DATABASE django_project;
CREATE USER username WITH PASSWORD 'pass1234';
ALTER ROLE username SET client_encoding TO 'utf8';
ALTER ROLE username SET default_transaction_isolation TO 'read committed';
@renaudtertrais
renaudtertrais / zip.js
Created Jul 5, 2016
A simple ES6 zip function
View zip.js
const zip = (arr, ...arrs) => {
return arr.map((val, i) => arrs.reduce((a, arr) => [...a, arr[i]], [val]));
}
// example
const a = [1, 2, 3];
const b = [4, 5, 6];
const c = [7, 8, 9];
@subfuzion
subfuzion / curl.md
Last active Apr 11, 2021
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@deanhume
deanhume / XHR-request.js
Created Aug 19, 2015
A simple XHR request
View XHR-request.js
function successListener() {
var data = JSON.parse(this.responseText);
console.log(data);
}
function failureListener(err) {
console.log('Request failed', err);
}
var request = new XMLHttpRequest();
@mrkline
mrkline / c_sharp_for_python.md
Last active Mar 28, 2021
An intro to C# for a Python developer. Made for one of my coworkers.
View c_sharp_for_python.md

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,

@chriskiehl
chriskiehl / Vitual keystroke example
Created Jun 10, 2012
Python win32api simple Vitual keystroke example
View Vitual keystroke example
#Giant dictonary to hold key name and VK value
VK_CODE = {'backspace':0x08,
'tab':0x09,
'clear':0x0C,
'enter':0x0D,
'shift':0x10,
'ctrl':0x11,
'alt':0x12,
'pause':0x13,
'caps_lock':0x14,