Skip to content

Instantly share code, notes, and snippets.

View EugZol's full-sized avatar

Eugene Zolotarev EugZol

  • Russia, Moscow region
View GitHub Profile
@rpuntaie
rpuntaie / python_oauth_libraries.rst
Last active February 23, 2021 01:24
OAuth2 social login. First file: attempt to use just the data from django-allauth. Second file: social-core based solution actually adopted.

Python OAuth Libraries

Googling for OAuth for python returns many results, but not immediately the relevant ones, i.e. up-to-date, independent, authoritative implementations. So it took me more than necessary to adopt the right library. Here is my conclusion about the current state, to possibly abbreviate the search time for OAuth new-comers.

@revgum
revgum / Dockerfile
Last active February 27, 2022 15:41
Lucky Framework Docker Development
FROM revgum/lucky
RUN mkdir /data
WORKDIR /data
ADD . /data
EXPOSE 5000
@victor9000
victor9000 / ublock-origin-pinterest
Created February 3, 2017 21:18
uBlock Origin filters to use Pinterest without having to log in
www.pinterest.com##.FullPageModal__scroller
www.pinterest.com##.Module.DenzelReactBridge > div > div:nth-of-type(2)
www.pinterest.com###desktopWrapper:style(position: relative !important)
@fredcy
fredcy / cartesian.elm
Last active November 2, 2019 18:03
Cartesian product of two lists in Elm
import Html exposing (text)
main =
text <| toString <| cartesian ["a", "b", "c"] [1..5]
cartesian : List a -> List b -> List (a,b)
cartesian xs ys =
List.concatMap
( \x -> List.map ( \y -> (x, y) ) ys )
xs
@ventsislaf
ventsislaf / phoenix_secret_key_base.sh
Last active August 1, 2020 06:20
Generate secret key base for Phoenix app
mix phoenix.gen.secret
@padde
padde / unicode_pattern_matching.exs
Created June 5, 2015 17:10
Elixir Unicode Pattern Matching
iex> <<first, rest::binary>> = "☺ how dare you, unicode!"
"☺ how dare you, unicode!"
iex> <<first>>
<<226>>
iex> rest
<<152, 186, 32, 104, 111, 119, 32, 100, 97, 114, 101, 32, 121, 111, 117, 44, 32, 117, 110, 105, 99, 111, 100, 101, 33>>
@dhbradshaw
dhbradshaw / gist:e2bdeb502b0d0d2acced
Last active August 16, 2023 17:50
Rename field using migrations in django 1.7
To change a field name in django 1.7+
1. Edit the field name in the model (but remember the old field name: you need it for step 3!)
2. Create an empty migration
$ python manage.py makemigrations --empty myApp
3. Edit the empty migration (it's in the migrations folder in your app folder, and will be the most recent migration) by adding
migrations.RenameField('MyModel', 'old_field_name', 'new_field_name'),
to the operations list.
@jd-boyd
jd-boyd / jsonpp.go
Last active November 28, 2021 06:30
A Json pretty printer written in golang.
//Build with: go build ./jsonpp.go
package main
import "encoding/json"
import "fmt"
import "io/ioutil"
import "os"
@MrChuffmanSnippets
MrChuffmanSnippets / index.html
Created March 15, 2012 10:05
HTML5: Blank Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<link href="style.css" rel="stylesheet" />
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
@danopia
danopia / database.yml
Created April 25, 2011 04:19
Default SQLite database.yml
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".