Skip to content

Instantly share code, notes, and snippets.

View nkgokul's full-sized avatar

Gokul N K nkgokul

View GitHub Profile
@steveruizok
steveruizok / getSegmentRoundedRectangleIntersection.ts
Created July 24, 2020 12:43
Get the points where a line segment intersects a rectangle with rounded corners.
/**
* Get the intersection points between a line segment and a rectangle with rounded corners.
* @param x0 The x-axis coordinate of the segment's starting point.
* @param y0 The y-axis coordinate of ththe segment's ending point.
* @param x1 The delta-x of the ray.
* @param y1 The delta-y of the ray.
* @param x The x-axis coordinate of the rectangle.
* @param y The y-axis coordinate of the rectangle.
* @param w The width of the rectangle.
@pratikone
pratikone / tweetthreader.py
Created March 17, 2020 02:30
This script fetches and creates threads from twitter statuses of a twitter profile. A thread is a series of tweets created by replying to your own tweet.
import os
import re
import time
from collections import namedtuple
import codecs
import tweepy
import json
from datetime import datetime
from requests.exceptions import Timeout, ConnectionError
from requests.packages.urllib3.exceptions import ReadTimeoutError, ProtocolError
@sriharsha1235
sriharsha1235 / Drupal 8 Dynamic Menu Title
Last active November 17, 2016 06:33
Dynamic Routing Menu Title
References
https://www.drupal.org/node/2122201
http://drupal.stackexchange.com/questions/189305/can-we-add-the-destination-query-parameter-to-a-link-from-yml-configuration
https://www.drupal.org/docs/8/api/routing-system/structure-of-routes
https://www.drupal.org/docs/8/api/menu-api/providing-module-defined-menu-links

A description of known problems in Satoshi Nakamoto's paper, "Bitcoin: A Peer-to-Peer Electronic Cash System", as well as notes on terminology changes and how Bitcoin's implementation differs from that described in the paper.

Abstract

The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.

@shrop
shrop / configure-env.sh
Last active December 16, 2015 07:48
A bash script to run when you want to configure your local development environment for Drupal development
#!/bin/bash
echo "Configuring local development environment for local.site..."
# Change directory to the webroot.
cd /var/www
# Sanitize the database.
drush sql-sanitize -y