Skip to content

Instantly share code, notes, and snippets.

View NatuMyers's full-sized avatar
🎯
Focusing

Natu Myers NatuMyers

🎯
Focusing
View GitHub Profile
@dideler
dideler / example.md
Last active February 17, 2024 20:24
A python script for extracting email addresses from text files.You can pass it multiple files. It prints the email addresses to stdout, one address per line.For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.

The program below can take one or more plain text files as input. It works with python2 and python3.

Let's say we have two files that may contain email addresses:

  1. file_a.txt
foo bar
ok ideler.dennis@gmail.com sup
 hey...user+123@example.com,wyd
hello world!
@revolunet
revolunet / landing-pages.md
Last active February 28, 2018 05:01
Beautiful SAAS landing pages
@jmasonherr
jmasonherr / connect_tutorial_python.py
Created May 12, 2014 18:28
Stripe connect tutorial for python
# coding: utf-8
import json
import stripe
import datetime
# Required for OAuth flow
from rauth import OAuth2Service
# Our secret key from stripe
STRIPE_SECRET_KEY = 'sk_test_xxxxxxxxxxxxx'
@armstrongnate
armstrongnate / basic-auth.swift
Created July 20, 2014 21:45
HTTP Basic Authentication using NSURLSession in swift
import Foundation
let config = NSURLSessionConfiguration.defaultSessionConfiguration()
let userPasswordString = "username@gmail.com:password"
let userPasswordData = userPasswordString.dataUsingEncoding(NSUTF8StringEncoding)
let base64EncodedCredential = userPasswordData!.base64EncodedStringWithOptions(nil)
let authString = "Basic \(base64EncodedCredential)"
config.HTTPAdditionalHeaders = ["Authorization" : authString]
let session = NSURLSession(configuration: config)
@dwayne
dwayne / getting-started.md
Last active February 23, 2017 18:49
Django Notes (Python 3.5.1 and Django 1.9.x)

Getting Started

Install Python, follow the steps here.

Steps I take when beginning a new Django project.

$ mkdir [project_name]_project
$ cd [project_name]_project
@hamzasood
hamzasood / gist:02e6e87835a17f4e1b9e
Created November 23, 2015 23:15
Apple Pencil 3D Touch
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
// Hook with ObjC runtime functions
%config(generator=internal)
// New methods created below
@interface UIGestureRecognizer ()
+ (void)hs_beginForcingAllNewGestureRecognizersToAllowPencilInput;
+ (void)hs_endForcingAllNewGestureRecognizersToAllowPencilInput;
@bitgord
bitgord / sol-wallet
Last active February 16, 2023 12:50
Wallet Smart Contract Using Solidity
contract SimpleWallet {
// address is the owner
address owner;
struct WithdrawlStruct {
address to;
uint amount;
}
anonymous
anonymous / MyEthBank.sol
Created February 20, 2018 00:54
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.20+commit.3155dd80.js&optimize=false&gist=
// Freestartupkits.com
pragma solidity ^0.4.11;
contract MyEthBank {
mapping (address => uint) private balances;
address owner;
uint constant totalSupply = 10**4;
function MyEthBank() public payable {
balances[msg.sender] = totalSupply;