Skip to content

Instantly share code, notes, and snippets.

View application2000's full-sized avatar
💡
You Found Your Solution.

Mr Alexandre ELISÉ application2000

💡
You Found Your Solution.
View GitHub Profile
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@Halleck45
Halleck45 / phing-audit.xml
Created September 27, 2012 14:34
Mini audit de code avec phing
<?xml version="1.0" ?>
<project name="audit" basedir="." default="audit">
<property name="style" value="ZEND" />
<property name="test" value="${source}/../test" />
<property name="test-bootstrap" value="" />
<target name="prepare">
<mkdir dir="${out}" />
</target>
@mashpie
mashpie / i18n-node-http.js
Last active May 3, 2021 17:50
basic plain vanilla setup in node with http
// require modules
var http = require('http'),
i18n = require('i18n'),
app;
// minimal config
i18n.configure({
locales: ['en', 'de'],
directory: __dirname + '/locales'
});
@pboos
pboos / annotation-processor-build.gradle
Last active August 7, 2020 06:38
Gradle stuff for Android
configurations {
apt
}
dependencies {
compile 'com.squareup.dagger:dagger:1.1.0'
apt 'com.squareup.dagger:dagger-compiler:1.1.0'
}
android.applicationVariants.all { variant ->
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@shakalaca
shakalaca / build.gradle
Last active December 30, 2022 08:34
move & rename APK files
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.6'
}
}
task wrapper(type: Wrapper) {
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@stefanhoth
stefanhoth / build.gradle
Created June 11, 2014 06:56
AndroidDev / gradle: How to rename your output apk during build time to include details like the version.
android {
// .. set up build flavors etc here
//instead of "app-release.apk" this method will rewrite the name to
// "MyCoolCompany-MyGreatProduct-v<defaultConfig.versionName>-RELEASE.apk which is much better suited for archiving and overall handling
// To restore the default behavior just delete the whole block below
applicationVariants.all { variant ->
def apk = variant.outputFile;
@sanderpotjer
sanderpotjer / edit.php
Last active May 5, 2023 03:08
Template override for improved Joomla article submission form
<?php
/**
* @package Article Form override for Joomla 3
* @copyright Copyright (c) 2014 Sander Potjer - www.perfectwebteam.nl
* @license GNU General Public License version 3 or later
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');