Skip to content

Instantly share code, notes, and snippets.

🐣
🐣

9kopb 9kopb

🐣
🐣
Block or report user

Report or block 9kopb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pugson
pugson / bookmarklet.js
Last active Aug 8, 2019
Open in Notion App (Bookmarklet)
View bookmarklet.js
javascript:(function()%7Bvar%20url%20%3D%20window.location.href%3Bvar%20trimmed%20%3D%20url.slice(5)%3Bwindow.location.href%20%3D%20%60notion%24%7Btrimmed%7D%60%7D)()
@Kmaschta
Kmaschta / generate-self-signed-certificate-with-custom-CA.md
Created Jan 9, 2019
How to generate a self-signed that is valid for your browser (by creating your custom certificate authority)
View generate-self-signed-certificate-with-custom-CA.md

If you're using self-signed certificate for your web server on development, you might know the browser warning saying that your certificate isn't valid. If like me you had manually added an exception for this certificate error each time it showed up, this gist is for you.

Properly Configure OpenSSL with your DNS aliases

You'll have to create a self-signed certificate with a custom SubjectAltName.

  1. Find your openssl config. find /usr/lib -name openssl.cnf
View testpool.js
// ==UserScript==
// @name Pixel Bot
// @namespace https://tampermonkey.net/
// @version 3.0
// @description try to take over the world!
// @author Flyink13, igoose
// @match https://pixel.vkforms.ru/*
// @grant none
// ==/UserScript==
View fiddle.html
Open the console to see the output of this example.
@dotcypress
dotcypress / telegram-login.js
Created Feb 24, 2018
Telegram authorization data checker
View telegram-login.js
const { createHash, createHmac } = require('crypto')
function checkSignature (token, { hash, ...data }) {
const secret = createHash('sha256')
.update(token)
.digest()
const checkString = Object.keys(data)
.sort()
.map(k => `${k}=${data[k]}`)
.join('\n')
View check_authorization.php
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@astericky
astericky / webpack.config.js
Created Mar 3, 2017
Webpack 2 Config Example
View webpack.config.js
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const VENDOR_LIBS = [
'react', 'react-dom', 'react-router', 'react-redux', 'redux', 'redux-thunk', 'lodash'
]
module.exports = {
@tejaslodaya
tejaslodaya / apply_df_by_multiprocessing.py
Created Feb 3, 2017
pandas DataFrame apply multiprocessing
View apply_df_by_multiprocessing.py
import multiprocessing
import pandas as pd
import numpy as np
def _apply_df(args):
df, func, num, kwargs = args
return num, df.apply(func, **kwargs)
def apply_by_multiprocessing(df,func,**kwargs):
workers=kwargs.pop('workers')
@9kopb
9kopb / _.js
Created Jan 1, 2017 — forked from dieseltravis/_.js
javascript bookmarklet to edit cookies on a page
View _.js
(function (w, d) {
var id = (new Date()).valueOf(),
itemTemplate = "<label>"
+ "<code>{name}=</code>"
+ "<input id='Cookie{name}{index}{id}' type='text' value='{value}' style='font-family:monospace;width:50%' />"
+ "</label>"
+ "<input type='button' value='Update' onclick='window.UpdateCookie{id}(\"{name}\", {index});' />"
+ "<input type='button' value='Delete' onclick='window.DeleteCookie{id}(\"{name}\");' />"
+ "<br/>",
formatTemplate = function (name, value, index) {
You can’t perform that action at this time.