Skip to content

Instantly share code, notes, and snippets.

View roshnet's full-sized avatar
🏎️
working from cache

Roshan Sharma roshnet

🏎️
working from cache
View GitHub Profile
@jimmywarting
jimmywarting / readme.md
Last active April 24, 2025 05:33
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@oxguy3
oxguy3 / deploy.php
Last active April 16, 2025 07:58
Script used to automatically deploy from GitHub to a cPanel shared hosting server
<?php
/**
* deploy.php by Hayden Schiff (oxguy3)
* Available at https://gist.github.com/oxguy3/70ea582d951d4b0f78edec282a2bebf9
*
* No rights reserved. Dedicated to public domain via CC0 1.0 Universal.
* See https://creativecommons.org/publicdomain/zero/1.0/ for terms.
*/
// random string of characters; must match the "Secret" defined in your GitHub webhook
@kgriffs
kgriffs / example.py
Created May 23, 2016 14:24
Example of using a Falcon middleware component to perform a permanent redirect
import falcon
from falcon import testing
class RedirectorComponent(object):
def process_request(self, req, resp):
raise falcon.HTTPMovedPermanently('http://example.org/foo')
class HelloResource(object):
@NamPNQ
NamPNQ / README.md
Last active September 20, 2021 21:16
bootmgfw.efi

What are you looking for? The file name bootmgfw.efi to fix window shjt cannot boot? This is here for you :D

@subfuzion
subfuzion / curl.md
Last active April 28, 2025 11:31
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@davemackintosh
davemackintosh / map-to-json.js
Last active August 7, 2023 15:49
Convert ES6 `Map`s to a standard JSON object without effing Babel.
/**
* Convert a `Map` to a standard
* JS object recursively.
*
* @param {Map} map to convert.
* @returns {Object} converted object.
*/
function map_to_object(map) {
const out = Object.create(null)
map.forEach((value, key) => {
@iansltx
iansltx / MultiPartFromStrings.php
Created May 2, 2015 03:31
Multipart file uploads in PHP from strings
<?php
/**
* PHP's curl extension won't let you pass in strings as multipart file upload bodies; you
* have to direct it at an existing file (either with deprecated @ syntax or the CURLFile
* type). You can use php://temp to get around this for one file, but if you want to upload
* multiple files then you've got a bit more work.
*
* This function manually constructs the multipart request body from strings and injects it
* into the supplied curl handle, with no need to touch the file system.
@ozh
ozh / git cherry-pick within a pull request.md
Last active January 6, 2025 03:16
git cherry-pick within a pull request

1. Create new branch:

git checkout -b otherrepo-master master

2. Get the contents of the PR

git pull https://github.com/otherrepo/my-repo-name.git master
@wrunk
wrunk / cheatsheet.go
Last active September 8, 2021 21:20
Go cheatsheet
/* This document is for quick ref while learning golang */
// Allocating Slices
// Using slice literals
// Make a slice of strings
strs := []string{"aaa", "bbb", "ccc", "ddd"}
// Bytes
key := []byte("5e8487e6")
// Declaring a var my_slice for later makeage
@matthieu
matthieu / gist:b07c5ba27bc99188a15f
Last active February 7, 2025 01:08
Create and send a Bitcoin transaction using the BlockCypher Transaction API
# In this example we're sending some test bitcoins from an address we control to a brand new test
# address. We'll be sending the coins using the following address, public and private keys (please
# don't abuse).
# address : mtWg6ccLiZWw2Et7E5UqmHsYgrAi5wqiov
# public : 03bb318b00de944086fad67ab78a832eb1bf26916053ecd3b14a3f48f9fbe0821f
# private : 1af97b1f428ac89b7d35323ea7a68aba8cad178a04eddbbf591f65671bae48a2
# 1. generate a one-shot dummy address we're going to send money to
$ curl -X POST http://api.blockcypher.com/v1/btc/test3/addrs
{