Skip to content

Instantly share code, notes, and snippets.

View Fechin's full-sized avatar
🎯
Focusing

Fechin Fechin

🎯
Focusing
View GitHub Profile
@timvlaer
timvlaer / gist:721ba30f8fc6a7aac1b0190e132a4261
Created March 21, 2017 12:35
Install Thrift 0.9.3 with brew on macOS
brew unlink thrift
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9d524e4850651cfedd64bc0740f1379b533f607d/Formula/thrift.rb
# 10_basic.py
# 15_make_soup.py
# 20_search.py
# 25_navigation.py
# 30_edit.py
# 40_encoding.py
# 50_parse_only_part.py
@joshlk
joshlk / faster_toPandas.py
Last active May 15, 2023 13:48
PySpark faster toPandas using mapPartitions
import pandas as pd
def _map_to_pandas(rdds):
""" Needs to be here due to pickling issues """
return [pd.DataFrame(list(rdds))]
def toPandas(df, n_partitions=None):
"""
Returns the contents of `df` as a local `pandas.DataFrame` in a speedy fashion. The DataFrame is
repartitioned if `n_partitions` is passed.
@blackgear
blackgear / surge.conf
Created October 26, 2015 05:39
Surge config for new user
[General]
loglevel = warning
bypass-system = true
skip-proxy = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,*.lan
bypass-tun = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12
dns-server = 114.114.114.114,114.114.115.115
[Proxy]
PROXY = custom,服务器地址,服务器端口,加密方式,密码,模块地址,tcp-fast-open=true
@jason5ng32
jason5ng32 / surge.conf
Last active April 7, 2024 13:04
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = PASSWORD@0.0.0.0:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD
@djandyr
djandyr / gist:3c083bd1790aeecd1c9e
Last active September 19, 2023 19:17
XAMPP Automatically start Apache (MacOS)

Automatically start XAMPP Apache when logging into MacOSX.

  1. Create xampp.startapache.plist in /Library/LaunchDaemons with the following content :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@efann
efann / postgresbackup.sh
Last active November 7, 2022 20:58
PostgreSQL Backup Script
# From http://www.cyberciti.biz/tips/howto-backup-postgresql-databases.html
# and from
# http://wiki.postgresql.org/wiki/Automated_Backup_on_Linux
#!/bin/bash
# License: Eclipse Public License - v 2.0 (https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html)
# Updated on November 7, 2022
# Example of how to run in cron
# 0 2 * * * su - postgres /usr/local/sbin/postgresbackup.sh
@bermi
bermi / os-detection.sh
Created November 21, 2012 16:29
Bash simple operating system detection
#!/bin/bash
os=${OSTYPE//[0-9.-]*/}
case "$os" in
darwin)
echo "I'm a Mac"
;;
msys)
@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@jesseyv
jesseyv / gist:1175064
Created August 27, 2011 06:24
Tornado Template Syntax
Basic Output
Hello, {{ current_user.name }}
Basic Logic
{% if not current_user %}
You're not logged in!
{% elif current_user and curent_user.is_admin %}
Good day, sir!
{% else %}