Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
import socket | |
if __name__ == "__main__": | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect(("localhost", 9000)) | |
data = "some data" | |
sock.sendall(data) | |
result = sock.recv(1024) | |
print result | |
sock.close() |
<?php | |
/** | |
* post-process.php | |
* make sure to include post-process.php in your functions.php. Use this in functions.php: | |
* | |
* get_template_part('post-process'); | |
* | |
*/ | |
function do_insert() { | |
if( 'POST' == $_SERVER['REQUEST_METHOD'] |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.
Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!
#!/usr/bin/env python | |
############################### README ############################### | |
# External dependencies: | |
# * libmagic | |
# * python-dateutil | |
# * python-magic | |
# * requests | |
# | |
# The shell command call at the end was tested with GNU date from GNU |
Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.
inotify-tools
is installed (https://github.com/rvoicilas/inotify-tools)<?php | |
//creating categories in magento 2 | |
//last verified Magento 2.2.0 27 Oct 2017 | |
use \Magento\Framework\App\Bootstrap; | |
echo 'code by harshvardhanmalpani'; | |
include('./app/bootstrap.php'); | |
$bootstrap = Bootstrap::create(BP, $_SERVER); | |
$objectManager = $bootstrap->getObjectManager(); | |
function createCategory($a='',$b=2,$c=true,$d='',$e='',$f='',$g='') { | |
global $objectManager; |
from apiclient.discovery import build | |
from apiclient import errors | |
from httplib2 import Http | |
from oauth2client import file, client, tools | |
from email.mime.text import MIMEText | |
from base64 import urlsafe_b64encode | |
SENDER = <sender> | |
RECIPIENT = <recipient> |
# A simple function that uses python3 and matplotlib, and creates a plain colored circle (transparent png image 500x500 px). | |
# Inputs are the color_list and and the name of the file. | |
# The color_list can include multiple colors. A single color create a circle with that color. | |
# Multiple colors create a circle divided equally by the sum of the colors | |
# my_dpi variable is needed in order to make matplotlib to print an image with a specific size (usually dpi=96). | |
# More on this SO post: https://stackoverflow.com/questions/13714454/specifying-and-saving-a-figure-with-exact-size-in-pixels | |
# | |
# here we are ploting a 500x500 image | |
# you can find your dpi by going here: https://www.infobyip.com/detectmonitordpi.php |