Skip to content

Instantly share code, notes, and snippets.

View ihfazhillah's full-sized avatar

IbnuAmin ihfazhillah

View GitHub Profile
@ihfazhillah
ihfazhillah / ._README.md
Last active January 6, 2020 01:33 — forked from twidi/._README.md
Pycharm and virtualenvwrapper, with postactivate

The problem

PyCharm has support for virtual environment.

But there are two problems:

  1. the virtual environment is not activated in the terminal (it is only in the python console)
  2. it doesn't support virtualenvwrapper and so doesn't run the postactivate file.

This gist is the solution I found to resolve these two problems.

@ihfazhillah
ihfazhillah / makeApolloFileHandler.js
Last active September 18, 2017 06:22
Make an apollo client instance capable of uploading files to Scaphold.io via GraphQL
import ApolloClient, { createNetworkInterface } from 'apollo-client';
import RecursiveIterator from 'recursive-iterator';
//import fetch from 'node-fetch';
import { print as printGraphQL } from 'graphql-tag/printer';
import _ from lodash;
export function makeApolloFileHandler() {
const url = `https://us-west-2.api.scaphold.io/graphql/my-awesome-app`;
const networkInterface = createNetworkInterface(url);
networkInterface.query = (request) => {
@ihfazhillah
ihfazhillah / git-stash.md
Created May 17, 2017 10:05 — forked from nepsilon/git-stash.md
Ever started working on the wrong branch with Git? — First published in fullweb.io issue #6

Git stash

Ever started working on the wrong branch with Git? Use gist stash! Here is how to proceed in 3 steps:

1. Use stash to detach unstaged changes:

$ git stash
from random import choice
from string import ascii_lowercase, ascii_uppercase, digits
from tkinter import Tk, Entry, Button, StringVar
def random_string(length):
return ''.join(choice(ascii_lowercase + digits + ascii_uppercase) for i in range(length))
root = Tk()
root.title('32 chars random string generator')