Skip to content

Instantly share code, notes, and snippets.

View maximkott's full-sized avatar
💭
☕️ + 🍕 + 🍺 = 1100 1010 0011

Maxim Kott maximkott

💭
☕️ + 🍕 + 🍺 = 1100 1010 0011
View GitHub Profile
// Modified from @mutsuda's https://medium.com/@mutsuda/create-an-ios-widget-showing-google-spreadsheets-data-856767a9447e
// by @levelsio
// HOW TO
// 1) Make a Google Sheet, we'll pull the first cell e.g. A1
// 2) Publish your Google Sheet, File -> Publish To Web
// 3) Copy the SHEET_ID in the URL, put it in here below:
const endpoint = "https://spreadsheets.google.com/feeds/cells/SHEET_ID/1/public/full?alt=json"
// 4) Install Scriptable @ https://apps.apple.com/us/app/scriptable/id1405459188
// 5) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc)
@aleclarson
aleclarson / rollup-typescript.md
Last active May 6, 2024 19:37
The best Rollup config for TypeScript libraries

Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking
🧐 Source maps

Install

@JohannesRudolph
JohannesRudolph / dbconnect-mongodb.sh
Created June 26, 2018 16:46
connect to cloud foundry db services via cf ssh tunnels
#!/bin/bash
set -e
container="$1:dbssh"
VCAP_SERVICES=$(cf ssh $container -c 'echo $VCAP_SERVICES')
MONGO_URI=$(echo $VCAP_SERVICES | jq -r .MongoDB[0].credentials.uri)
PARSED_URI=$(./parse-url $MONGO_URI)
@dmurawsky
dmurawsky / index.js
Last active May 22, 2024 19:01
How to make a page full height in Next.js
const FullHeightPage = () => (
<div>
Hello World!
<style global jsx>{`
html,
body,
body > div:first-child,
div#__next,
div#__next > div {
height: 100%;
@jarretmoses
jarretmoses / React Native Clear Cache
Last active March 11, 2024 10:20
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@jshimko
jshimko / docker-ssl-deployment.sh
Last active February 25, 2022 10:11
Deploy Reaction Commerce on Digital Ocean with Nginx and a Let's Encrypt SSL certificate
# start a server on Digital Ocean
# https://docs.docker.com/machine/drivers/digital-ocean/
docker-machine create \
--driver digitalocean \
--digitalocean-access-token <YOUR API KEY> \
--digitalocean-size 2gb \
reaction
# tell Docker to run commands on that server
@jaibeee
jaibeee / brew-perms.sh
Last active February 15, 2024 22:49
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@rmatil
rmatil / gist:4bc690f3884638c427c9
Last active October 27, 2018 03:00
Puphpet, Vagrant, PHPStorm and Xdebug

Setup Xdebug for PHPStorm on vagrant using PHP

Create Virtual Machine

Go to PUPHPET and create your VM. Check Install Xdebug on step 4 (Languages > PHP).

Configure Xdebug on the VM

First check that everything went right while provisioning your VM: Create a new file named info.php and put the following code in it:

#/usr/bin/php
@tbpgr
tbpgr / index.html
Created April 7, 2015 14:19
Chart.js LineChart Sample
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Line Chart Test</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
<script language="JavaScript"><!--
function displayLineChart() {
var data = {
labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :