Skip to content

Instantly share code, notes, and snippets.

View notpushkin's full-sized avatar
🕊️

Alexander Pushkov notpushkin

🕊️
View GitHub Profile
def correct?(users_guess,computer_number)
return computer_number == users_guess
end
# read http://peterdowns.com/posts/first-time-with-pypi.html
# make sure to have a ~/.pypirc configured with users and passwords
# go to the package folder
# publish package to test pypi
python setup.py register -r pypitest
python setup.py sdist upload -r pypitest
# publish package to live pypi
python setup.py register -r pypi
— Мержь код, блядь, на. Мержь код.
— Чем, vimdiff что ли?
— Мержь. Мержь код! Садись уже. Садись! Мержь!
— Блядь.
— Чтобы чисто было!
— Как я буду vim'ом-то мержить?
— Мержь!
— Покажи мне, как!
— Мержь! (Уходит.)
— Что «мержи», ёпта, как я буду vim-то мержить?! Чё, совсем мудак что ли, покажи мне, как я буду мержить-то, ёпта!
@developit
developit / compositional-components-demo.js
Created January 7, 2017 22:44
Demonstrates compositional components in Preact (or React). Live demo: https://jsfiddle.net/developit/umnb4y87/
import { h, cloneElement, Component } from 'preact';
/** Example <Fetch url="/foo.json" /> compositional component.
* Just to demonstrate a compositional component that requires input massaging.
*/
class Fetch extends Component {
state = { loading: true };
componentDidMount() {
this.update();
Fight Back - Neffex
Run Run Blood - Phantogram
Mein schönster Tag in deinem Leben - Rakede
Black Cats Ft Drakezilla & Saving Grace - Mind Over Matter
Still Alive (Teddybears Mix) - Lisa Miskovsky
6.24 - Danger
One Touch - VIP - Baauer
Pi - Käptn Peng
Birds In The Sky - Bliss n Eso
Black Barbies - Nicki Minaj
// - yes, this is the entire implementation
// - no, it doesn't actually depend on preact
export class Provider {
getChildContext () {
let { children, ...context } = this.props;
return context;
}
render ({ children }) {
return children && children[0] || null
}
const React = require("react");
const Lifecycles = React.createLifecycleEvents({
didMount({ setState }) {
setState({
disabled: false,
});
},
didUpdate({ inputRef }) {
if (document.activeElement !== inputRef.value) {
@jtratner
jtratner / generate_typed_dicts.py
Created April 10, 2018 00:32
Example of auto generating type stubs
from datetime import datetime
STRING_DEFAULT = 'string'
DATETIME_DEFAULT = datetime(2015, 1, 1)
INT_DEFAULT = 123
def generate_typed_dicts(name, nested_dict):
full_context = []
final_dict = [f"class {name}(TypedDict):"]
@mrsweaters
mrsweaters / pause_and_resume.md
Created August 22, 2012 23:36
Joyride 2 Pause and Resume Example

The below configuration will pause the tour after tooltip 2 has appeared (index of 1). In the postStepCallback we check to see if the tour has been paused and fire some code.

<script>
  $(window).load(function() {
    $('#joyRideTipContent').joyride({
      pauseAfter : [1],
      postStepCallback : function (index, tip) {
        if ($(this).joyride('paused')) {
 console.log('Hey there, you\'ve paused the tour.');
@nakanod
nakanod / .docker.env
Last active April 11, 2020 15:00
Pleroma docker files
HOST=pleroma.example.com
SECRET_KEY_BASE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx