Skip to content

Instantly share code, notes, and snippets.

@cyborgshead
cyborgshead / aragon_bare_setup.md
Last active November 25, 2021 13:28
Aragon DAO bare setup

Prepare ~/.aragon/rinkeby_key.json

{
  "rpc": "https://<network>.infura.io",
  "keys": ["put-your-priv-key-here"]
}

Bootstrap

@kn1cht
kn1cht / circular.py
Last active March 19, 2024 05:39
Circular Statistics by Python
import cmath
import numpy as np
import scipy.stats as stats
def mean(angles, deg=True):
'''Circular mean of angle data(default to degree)
'''
a = np.deg2rad(angles) if deg else np.array(angles)
angles_complex = np.frompyfunc(cmath.exp, 1, 1)(a * 1j)
mean = cmath.phase(angles_complex.sum()) % (2 * np.pi)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@AlexArcPy
AlexArcPy / shp2geojson.py
Created July 28, 2017 09:52
Convert shapefile to GeoJSON with ogr and Python
import json
import ogr
driver = ogr.GetDriverByName('ESRI Shapefile')
shp_path = r'C:\GIS\Temp\Counties.shp'
data_source = driver.Open(shp_path, 0)
fc = {
'type': 'FeatureCollection',
'features': []
@darwing1210
darwing1210 / wordpress_fabfile.py
Last active August 9, 2019 23:29
A Python Fabfile to deploy a wordpress site over SSH
import os
from time import time
from fabric.api import sudo, run, task, env, cd, get, local
from fabric.context_managers import shell_env
env.hosts = ['yourhost']
env.user = 'yoursshuser'
env.password = 'yoursshpassword'
# env.key_filename = '~/yourkey.pem'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@snurhussein
snurhussein / PSPPConvert.md
Last active October 31, 2021 23:49
Using PSPP to convert sav files to csv

#Converting SPSS files to csv with PSPP#

Install and open PSPP Use the File menu to open your file (it probably has a .sav extension) Go to File>New>Syntax to open PSPP's command line window

Enter:

@wookietreiber
wookietreiber / default.pa
Created November 29, 2015 10:44
stream with ffmpeg, pulseaudio.
# To record both mic and other audio input sources we need to add a named output sink. See:
# http://www.linuxquestions.org/questions/linux-software-2/alsa-and-pulseaudio-recording-multiple-input-devices-877614/
# http://www.youtube.com/watch?v=oJADNOY615Y&feature=player_embedded
# Add this to your /etc/pulse/default.pa file
load-module module-null-sink sink_name=stream
load-module module-loopback latency_msec=5 sink=stream
load-module module-loopback latency_msec=5 sink=stream
@Guitlle
Guitlle / gscope.c
Created April 18, 2013 22:48
Osciloscopio para la launchpad MSP430 con el chip msp430g2553. Tiene 8 velocidades y funciona vía el puerto seria (UART) para que funcione deben voltear los JUMPERs que dicen TX y RX (hardware uart). A 9600 baudios por segundo, se le envía un caracter y la launchpad responde con 200 datos obtenidos mediante el ADC . Requiere que el cristal que t…
#include "msp430g2553.h"
#include "stdbool.h"
#define LED BIT6
#define RXD BIT1
#define TXD BIT2
unsigned int i; // for loop variable
volatile unsigned char rx_flag = 0;
volatile unsigned char tx_flag = 0;