Skip to content

Instantly share code, notes, and snippets.

View shekarsiri's full-sized avatar
👋

Shekar Siri shekarsiri

👋
View GitHub Profile
@AnasAlmasri
AnasAlmasri / SentimentAnalysis.py
Last active November 9, 2020 04:37
full code
import twitter
# initialize api instance
twitter_api = twitter.Api(consumer_key='YOUR_CONSUMER_KEY',
consumer_secret='YOUR_CONSUMER_SECRET',
access_token_key='YOUR_ACCESS_TOKEN_KEY',
access_token_secret='YOUR_ACCESS_TOKEN_SECRET')
# test authentication
print(twitter_api.VerifyCredentials())
@stremsdoerfer
stremsdoerfer / swiftHTTPPOST.swift
Last active December 22, 2017 10:18
POST request example in Swift
var request = URLRequest(url:URL(string:"http://localhost:8888/login")!)
request.httpMethod = "POST"
let params = ["email":"name@mail.com", "password":"password"]
request.httpBody = try? JSONSerialization.data(withJSONObject: params, options: [])
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
URLSession.shared.dataTask(with: request) { (data:Data?, response:URLResponse?, error:Error?) in
if let safeData = data{
print("response: \(String(data:safeData, encoding:.utf8))")
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@leonardofed
leonardofed / README.md
Last active June 17, 2024 14:54
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


import sys
def create_map(filename):
f = open(filename, "r")
lines = f.readlines()
rows = int(lines[0].split()[0])
cols = int(lines[0].split()[1])
skimap = [[int(c) for c in lines[i].split()] for i in range(1,len(lines))]
@DenisIzmaylov
DenisIzmaylov / INSTALLATION.md
Last active April 27, 2023 15:44
OS X 10.11 El Capitan: fresh install with Node.js (io.js) Developer Environment

OS X 10.11 (El Capitan) / Node.js and io.js Developer Environment

Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.

Content

@WayneSan
WayneSan / authentication.py
Last active January 7, 2024 20:34
PyJWT + Django REST framework 2
import jwt
from django.conf import settings
from django.contrib.auth.models import User
from rest_framework import exceptions
from rest_framework.authentication import TokenAuthentication
class JSONWebTokenAuthentication(TokenAuthentication):
@soufianeEL
soufianeEL / laravel.js
Last active June 18, 2023 05:25 — forked from JeffreyWay/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
/*
Exemples :
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}">
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?">
*/
(function() {
@iolson
iolson / AuthenticateController.php
Last active December 4, 2022 23:24
SentinelAuthAdapter for using Tymon\JWTAuth with Cartalyst\Sentinel
<?php namespace App\Http\Controllers\Api\V1;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use Illuminate\Http\Request;
use Tymon\JWTAuth\Facades\JWTAuth;
use Tymon\JWTAuth\Exceptions\JWTException;
class AuthenticateController extends Controller
{
@hackel
hackel / SentryAuthAdapter.php
Last active June 24, 2021 14:48
SentryAuthAdapter for using Tymon\JWTAuth with Cartalyst\Sentry
<?php namespace MyApp\Providers;
use Exception;
use Cartalyst\Sentry\Sentry;
use Cartalyst\Sentry\Users\UserInterface;
use Tymon\JWTAuth\Providers\Auth\AuthInterface;
class SentryAuthAdapter implements AuthInterface
{
/**