Skip to content

Instantly share code, notes, and snippets.

View idchlife's full-sized avatar
💭
anybody here? lol 🦀

idchlife idchlife

💭
anybody here? lol 🦀
  • PIE Studio
  • Space Station 12
View GitHub Profile
@tbranyen
tbranyen / es-modules-diffhtml.html
Last active June 1, 2017 17:50
Loading some middleware and diffHTML with ES Modules in Chromium 60
<style>
body { display: flex; align-items: center; justify-content: center; }
h1 { font-size: 60px; font-family: Helvetica; }
</style>
<script type="module">
import { innerHTML, html, use } from 'https://diffhtml.org/master/diffhtml';
import createLogger from 'https://diffhtml.org/master/diffhtml-middleware-logger';
import inlineTransitions from 'https://diffhtml.org/master/diffhtml-middleware-inline-transitions';
@averagehuman
averagehuman / postgres-docker-config.sh
Last active April 3, 2019 22:36
Run postgres on docker host, connect from docker containers
#!/bin/bash
################################################################################
# Rather than run postgres in its own container, we want to run it on
# the (Ubuntu) host and allow:
#
# + peer connections on the host
# + local md5 connections from any docker container
#
# THIS IS COPY/PASTED FROM COMMAND LINE INPUT AND IS UNTESTED AS A SINGLE SCRIPT
################################################################################
@folivares
folivares / laravel_nginx.md
Last active November 9, 2020 16:45
Nginx configuration for Laravel 5.1

Nginx Server Blocks configuration to run more than one Laravel 5.1 web-app off of a single Linux server

Prerequisites

  • PHP package: php5-fpm php5-mcrypt php5-mysql
  • Laravel 5.1
  • Nginx 1.8

Default Server Block

@JfrAziz
JfrAziz / docker-compose.yml
Last active March 20, 2022 12:22
Run Code Server Using docker-compose
version: "3.1"
services:
vscode:
container_name: vscode
image: codercom/code-server
ports:
- "8080:8080"
volumes:
- ./.config:/home/coder/.config
@mattdesl
mattdesl / modules.md
Last active August 16, 2022 10:14
my favourite modules.
@danvbe
danvbe / 1-Explanations.md
Last active April 21, 2023 15:39
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
@suissa
suissa / watermark.js
Last active June 12, 2023 10:07
Add watermark with Node.js and ffmpeg
var ffmpeg = require('ffmpeg');
try {
var process = new ffmpeg('example.mp4');
process.then(function (video) {
console.log('The video is ready to be processed');
var watermarkPath = 'watermark-suissa.png',
newFilepath = './video-com-watermark.mp4',
settings = {
position : "SE" // Position: NE NC NW SE SC SW C CE CW
@Ocramius
Ocramius / Rand.php
Created April 14, 2011 13:23
MySQL RAND() function in Doctrine2 DQL
<?php
namespace My\Custom\Doctrine2\Function;
/**
* RandFunction ::= "RAND" "(" ")"
*/
class Rand extends FunctionNode
{
public function parse(\Doctrine\ORM\Query\Parser $parser)
@SpaceVoyager
SpaceVoyager / pythonista_compile_howto.md
Last active December 2, 2023 11:58
How to make a standalone iOS app with Pythonista

After you made some cool games or apps with Pythonista, you may want to make it run as a standaone app on iPad/iPhone and possibly share it on the AppStore. This how-to tells you how to do it.

What you need:

  1. Pythonista code you wrote
  2. A Mac with Xcode 7.1 installed
  3. iPhone/iPad running iOS 9

Steps:

  1. Download PythonistaProjectTemplate.zip. The original PythonistaProjectTemplate described at http://olemoritz.net/pythonista-15-whats-new-and-whats-missing.html does not work with Xcode 7. I updated it to work with Xcode 7 and added a more interesting example than the plain old Hello World thing.
  2. Unzip the file and open the project in Xcode 7.1. In project settings, change the Bundle Identifier from com.yuhangwang.pythonistaproject to something else.
@anotheruiguy
anotheruiguy / life-in-terminal.md
Last active February 27, 2024 13:53
Life inside Terminal
Or Bash to the UNIX kids

If you are reading this, you have been introduced to something called the Terminal on your Mac by one of your overly pushy developer friends/colleagues.

I am thinking that the conversation went something like this?

You: How can I get to that file?

Them: Just open Terminal and then $ cd ~/Projects/boilerplate/ && vi .gitignore