Skip to content

Instantly share code, notes, and snippets.

View wegorich's full-sized avatar
💩
Crappy codding

Egor Malkevich wegorich

💩
Crappy codding
View GitHub Profile
@lenolib
lenolib / enumerate-notion-items.py
Created December 11, 2019 11:17
Create a unique sequential id for items (tasks) in a notion database / view
import re
from notion.client import NotionClient
def enumerate_notion_items(
view_url, id_col, created_at_col="created_time", token=None, client=None
):
"""
Given that a property with name e.g. "Item ID" exists for a notion dataset,
and that at least one item has a value for that property, this function
@gaearon
gaearon / MyResponsiveComponent.js
Created November 1, 2018 10:05
Examples from "Making Sense of React Hooks"
function MyResponsiveComponent() {
const width = useWindowWidth(); // Our custom Hook
return (
<p>Window width is {width}</p>
);
}
@zkat
zkat / index.js
Last active March 10, 2024 14:32
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@strrife
strrife / .bash_profile
Last active April 11, 2016 19:11
<3 Aliases
alias fuck="sudo"
alias gitf="git fetch"
alias gimme="brew install"
alias vhosts="fuck nano /etc/apache2/extra/httpd-vhosts.conf"
alias jspf="jspm i --unlink --force"
alias rserv="brew services restart
alias a2r="sudo apachectl -k restart"
alias dm="docker-machine"
denv(){
@strrife
strrife / toto.sh
Last active January 25, 2016 19:28
sudo apt-get update -y
sudo apt-get install -y git
sudo gem install sass
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo apt-get install -y build-essential tcl8.5
wget http://download.redis.io/releases/redis-stable.tar.gz
@samma835
samma835 / xcarchive2ipa
Created December 23, 2015 07:21
How to convert .xcarchive to .ipa
xcodebuild -exportArchive -exportFormat ipa -archivePath {PATH}/MyApp.xcarchive -exportPath ~/Desktop/MyApp.ipa
@danharper
danharper / demo.md
Last active January 20, 2024 16:09
Open native Maps apps on iOS and Android in Cordova
iOS (with pin, iOS will lookup address too and show that as label)
maps://?q=LAT,LNG
Android, no pin (just open at location)
geo:LAT,LNG
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@eugene-ilyin
eugene-ilyin / cookie.js
Created October 21, 2014 08:50
Work with cookies in native Javascript
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active April 19, 2024 01:50
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html