Skip to content

Instantly share code, notes, and snippets.

View kekbait's full-sized avatar
🐱
Happy !

kekbait

🐱
Happy !
View GitHub Profile
@beberlei
beberlei / Document.php
Created May 18, 2011 10:46
My Symfony2 File Upload workflow
<?php
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* @Entity
*/
class Document
{
@pksunkara
pksunkara / config
Last active June 21, 2024 08:46
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@mikesmullin
mikesmullin / chromedriver.sh
Created May 8, 2012 16:08
easily install chromedriver on linux/osx
sudo apt-get install unzip;
wget -O /tmp/chromedriver.zip http://chromedriver.googlecode.com/files/chromedriver_linux64_19.0.1068.0.zip && sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/;
@binabik
binabik / bootstrap_phpunit.php
Created August 9, 2012 09:24
bootstrap phpunit tests
<?php
use Symfony\Bundle\SecurityBundle\Command\InitAclCommand;
use Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand;
use Doctrine\Bundle\DoctrineBundle\Command\Proxy\CreateSchemaDoctrineCommand;
use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand;
use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand;
require_once __DIR__.'/bootstrap.php.cache';
require_once __DIR__.'/AppKernel.php';
@mcsf
mcsf / gist:3623303
Created September 4, 2012 16:43
Simple e-mail notifications for Gmail. Requires Desktop Notifications and wget/curl.
#!/usr/bin/env python
# Limitations:
# - only the last sender will be shown for a given conversation with
# multiple new messages
# TODO
# - chmod for config file
# - config for every default value
@trungly
trungly / simple_server.py
Last active February 1, 2024 18:51
A simple Python HTTP server that supports a GET that echoes some request data and a POST that reads a request body, parses it as JSON and responds with part of the data
from BaseHTTPServer import BaseHTTPRequestHandler
import urlparse, json
class GetHandler(BaseHTTPRequestHandler):
def do_GET(self):
parsed_path = urlparse.urlparse(self.path)
message = '\n'.join([
'CLIENT VALUES:',
'client_address=%s (%s)' % (self.client_address,
@sloria
sloria / bobp-python.md
Last active June 18, 2024 08:18
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@hrwgc
hrwgc / validate.sh
Created November 13, 2013 19:57
bash wget - check if file exists at url before downloading
#!/bin/bash
# simple function to check http response code before downloading a remote file
# example usage:
# if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi
function validate_url(){
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi
}
@alain-andre
alain-andre / mongodb_specials.md
Last active May 12, 2021 08:22
Les Aggregations sous MongoDB (informations issues de leurs cours)

Aggregation

Pipeline

  • $project - Sélectionnez, remodeler - 1:1
  • $match - Filtrer - n:1
  • $group - Agréger - n:1
  • $sort - Trier - 1:1
  • $skip - Sauter - n:1
  • $limit - Limiter - n:1
  • $unwind - Découper un champ (array) - 1:n
@miguelmota
miguelmota / README.md
Last active May 25, 2024 13:23
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/