Skip to content

Instantly share code, notes, and snippets.

😃
😀

Manfred Touron moul

😃
😀
Block or report user

Report or block moul

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@henrik
henrik / examples.coffee
Created Feb 12, 2012
Animate number changes step by step (e.g. "1.1" -> "1.2" -> "1.3") with CoffeeScript and jQuery. And some other methods around number formatting.
View examples.coffee
# Examples
console.log NumberWrangler.format(123456.78)
console.log NumberWrangler.format("1234")
console.log NumberWrangler.formatDecimalComma("123456.78")
console.log NumberWrangler.parse("123,4 56.78")
console.log NumberWrangler.parseDecimalComma("123.4 56,78")
console.log NumberWrangler.countDecimals(1.2345)
# Requires jQuery:
@moul
moul / cdiscount.com
Created Mar 27, 2012
Personalized Web Options
View cdiscount.com
[{"name":"Standard AdBlocker","urlRegex":"^http://","urlExcludeRegex":"","enabled":false,"preserveDocWrite":false,"css":"","html":"","js":"","filters":[{"tags":"div,table","attribute":"id,class","value":"","valueRegex":"([-_]|\\b)(MarketGid(Composite)?\\d+|(adv?|ban(ner)?)\\d+x\\d+|y\\d+_direct\\d+)([-_]|\\b)"},{"tags":"div,table","attribute":"id,class","value":"","valueRegex":"^(top|left|right|bottom)[-_]?(ad|ban(n?er)?)s?\\d*(x\\d+)?$"},{"tags":"div,table","attribute":"id,class","value":"","valueRegex":"([-_]|\\b)(adv?|ban(n?er)?)[-_]?\\d+x\\d+[-_]?[a-z]*([-_]|\\b)"},{"tags":"div,table","attribute":"id,class","value":"","valueRegex":"([-_]|\\b)(bann?er|reklama|advertisement)s?[-_]?\\d*(x\\d+)?([-_]|\\b)"},{"tags":"div,table","attribute":"id,class","value":"","valueRegex":"([-_]|\\b)sidebar[-_]?ads?([-_]|\\b)"},{"tags":"","attribute":"id,class","value":"begun_table,baner,banner,ad,adv,reklama,google_companion_ad_div,google_ads_site,Advertisement,adBar,adBox","valueRegex":""},{"tags":"div","attribute":"id","v
@paulmillr
paulmillr / active.md
Last active May 22, 2020
Most active GitHub users (by contributions). http://twitter.com/paulmillr
View active.md

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Tue, 06 Dec 2016 17:06:46 GMT till Wed, 06 Dec 2017 17:06:46 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
  .filter(user => user.followers > 1000)
@andrewdeandrade
andrewdeandrade / app.js
Created Jun 29, 2012
Node.js ('child_process').spawn bug with SSH
View app.js
var spawn = require('child_process').spawn
var instance = {
ipAddress: "0.0.0.0"
};
var awsPreSharedKeyPath = '~/.ssh/aws-preshared-key.pem'; // make sure key has permissions 600 with chmod
var spawnArgs = [ '-tt', // force teletype since ssh uses a psuedo-terminal
@piscisaureus
piscisaureus / pr.md
Created Aug 13, 2012
Checkout github pull requests locally
View pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jedy
jedy / go_scp.go
Last active Jan 31, 2020
an example of scp in golang
View go_scp.go
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
@mathieue
mathieue / udp-multi-socat.sh
Created Aug 28, 2012
udp multiplexer with socat
View udp-multi-socat.sh
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140)
@pathikrit
pathikrit / sudoku-1.coffee
Created Oct 10, 2012
1-liner CoffeeScript Sudoku Solver
View sudoku-1.coffee
solve = (s, c = 0) -> if c is 81 then s else if s[x = c/9|0][y = c%9] isnt 0 then solve s, c+1 else (([1..9].filter (g) -> ![0...9].some (i) -> g in [s[x][i], s[i][y], s[3*(x/3|0) + i/3|0][3*(y/3|0) + i%3]]).some (g) -> s[x][y] = g; solve s, c+1) or s[x][y] = 0
@guiambros
guiambros / cloud-init.sh
Created Oct 22, 2012
Cloud-Init.sh - Amazon EC2 initial instance setup script (tested with Ubuntu 12.04 LTS)
View cloud-init.sh
#!/bin/bash
function getpublickey()
{
x=$(curl -fs http://169.254.169.254/latest/meta-data/public-keys/)
if [ $? -eq 0 ]; then
for i in $x; do
index=$(echo $i|cut -d = -f 1)
format=$(curl -s http://169.254.169.254/latest/meta-data/public-keys/$index/)
echo $(curl -s http://169.254.169.254/latest/meta-data/public-keys/$index/$format)
@minitech
minitech / web-checklist.md
Last active Jan 4, 2020
minitech’s Web Checklist
View web-checklist.md

minitech’s Web Checklist

Here are some guidelines that will make me actually like your amazing new web application!

  1. Make sure encoding is handled properly every step of the way. If comes out as ’, you’ve got a problem on your hands. 😊

  2. Make it accessible. Turn off images, JavaScript, and CSS. If your website is still legible and usable (it’s okay if it’s just barely usable, or not particularly interactive) then you are already in the top 0.01%.

  3. Check your grammar. One of the fastest ways to lose respect in a blog post (or worse — in body copy) is to make basic orthographical or grammatical mistakes. These include, but are not limited to:

    • Missing apostrophes — [Bitbucket even did that][bitbucket-apostrophe-catastrophe].
You can’t perform that action at this time.