Skip to content

Instantly share code, notes, and snippets.

@kimek
kimek / dep.md
Created May 3, 2024 07:33 — forked from dimabory/dep.md
Dependency Elimination Principle
@kimek
kimek / download_files_from_googledrive.py
Created January 23, 2024 17:18 — forked from swyoon/download_files_from_googledrive.py
A script for downloading all files in a Google Drive folder.
"""
A Python script for downloading all files under a folder in Google Drive.
Downloaded files will be saved at the current working directory.
This script uses the official Google Drive API (https://developers.google.com/drive).
As the examples in the official doc are not very clear to me,
so I thought sharing this script would be helpful for someone.
To use this script, you should first follow the instruction
in Quickstart section in the official doc (https://developers.google.com/drive/api/v3/quickstart/python):
@kimek
kimek / oneliners.js
Created April 2, 2019 07:53 — forked from mikowl/oneliners.js
👑 Awesome one-liners you might find useful while coding.
// By @coderitual
// https://twitter.com/coderitual/status/1112297299307384833
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// Type this in your code to break chrome debugger in that line.
@kimek
kimek / .htaccess
Created March 15, 2019 12:19 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@kimek
kimek / README.md
Created January 17, 2019 09:15 — forked from tjamps/README.md
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 :

@kimek
kimek / scroller.js
Created May 16, 2017 12:24 — forked from Cosmicist/scroller.js
Vanilla Javascript Scrolling function for easing based scrolling
var Scroller = function(anchors, config)
{
var cfg = compile({
duration: 1000,
offset: 0,
easing: Scroller.easing.inOutQuad,
callback: function() {}
}, config);
[].forEach.call(anchors, function(anchor) {
@kimek
kimek / setup_selenium.sh
Created May 4, 2017 15:13 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in