Skip to content

Instantly share code, notes, and snippets.

View jhonvidal's full-sized avatar
✍️
🐧 💻 ⚽ 🏃

Jhon Vidal jhonvidal

✍️
🐧 💻 ⚽ 🏃
View GitHub Profile
@BlueDrink9
BlueDrink9 / lazy.nvim adapter for vim-plug.md
Last active February 29, 2024 16:27
Share your vim-plug plugins with your lazy.nvim neovim setup, with minimal performance loss

lazy.nvim adapter for vim-plug

This is a drop-in adapter layer for vim-plug and lazy.nvim, allowing you to have a core set of vim plugins, configured with Plug, which will also be loaded using lazy.nvim instead whenever you use neovim (alongside any additional set of lazy.nvim plugins you have configured.)

It works by adding a new command Plugin as a drop-in Plug replacement. That calls a function that sets up lazy.nvim specs for the equivalent Plug args, and stores them in a variable that you can then add to your lazy spec.

-- Plugin Manager: install plugins
-----------------------------------------------------------
local vim = vim
local execute = vim.api.nvim_command
local fn = vim.fn
local package_root = require('utils').get_package_root()
local install_path = require('utils').get_install_path()
local compile_path = require('utils').get_compile_path()
local packer_bootstrap
@oakbani
oakbani / credit_card_16_digit_random_generator.py
Last active April 24, 2018 00:08
Credit Card 16-digit Random Number Generator
# This method generates a 16 digit random credit card number.
# If 'secure' flag is True, One of the four digits of every four digits, is replaced by a random Upper case letter.
import random
def generate_random_num(secure=False):
random.seed()
credit_card_num = []
for i in range(4):
@random-robbie
random-robbie / ccgen.py
Created July 26, 2017 08:37
Credit Card Number Generator
#### Credit Card Generator
#### Made By Random_Robbie
####
#### For testing Websites the data here is scraped from a website and the numbers and details are randomly generated no data is real!!
####
import requests
import re
### Grab Data from http://credit-card-generator.2-ee.com/
session = requests.Session()
@chris95x8
chris95x8 / build.gradle
Created October 28, 2014 14:00
Extended toolbar with two floating-label edit texts. The layout was made according to this image from the Material Design guidelines: http://i.imgur.com/x8QsuxU.png The layout below looks like this: http://i.imgur.com/8sOTv7h.png
dependencies {
compile 'com.android.support:appcompat-v7:21.+'
compile 'com.wrapp.floatlabelededittext:library:0.0.5'
}
@EvlinLee
EvlinLee / JsonArrayPostRequest.java
Created June 13, 2014 15:51
android volley jsonarray post method with params
public class JsonArrayPostRequest extends Request<JSONArray>{
private Map<String,String> mParam;
private Listener<JSONArray> mListener;
public JsonArrayPostRequest(String url,Listener<JSONArray> listener, ErrorListener errorListener,Map param) {
super(Request.Method.POST, url, errorListener);
mListener=listener;
mParam=param;
}
@LucasRoesler
LucasRoesler / middleware.py
Last active June 27, 2023 17:01
A Django middleware that process JSON data into the appropriate GET or POST variable. I use this with AngularJS, by default POST requests are sent as JSON instead of the urlencoded data expected by Django.
class JSONMiddleware(object):
"""
Process application/json requests data from GET and POST requests.
"""
def process_request(self, request):
if 'application/json' in request.META['CONTENT_TYPE']:
# load the json data
data = json.loads(request.body)
# for consistency sake, we want to return
# a Django QueryDict and not a plain Dict.
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@Stanback
Stanback / nginx.conf
Last active May 3, 2024 12:01 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@josefeg
josefeg / CreditCardNumberGenerator.java
Last active February 27, 2024 17:04
Credit card number generator in Java
import java.util.Random;
/**
* A credit card number generator.
*
* @author Josef Galea
*/
public class CreditCardNumberGenerator {
private Random random = new Random(System.currentTimeMillis());